LearnPy Hub
← Strings problems
Medium

Shared Beginning

Read two words and print the longest beginning they share, or none if the first letters differ.

Input

Two lines.

Output

One line.

Sample 1

Input
flower
flow
Output
flow

Sample 2

Input
dog
cat
Output
none
solution.py
Output appears here
Shared Beginning · Python practice problem · LearnPy Hub