def first_alpha():
    s = input()
mn, curr = s[0], s[0]
i = 1
while i < len(s):
    if s[i] == ' ':
        if curr < mn:
            mn = curr
curr = s[i + 1]
i += 1
return mn if curr > mn else curr
Wrong output in python string loop