Buggy python submission (verdict: Runtime Error):
S = list(input())
T = list(input())
S = sorted(S)
T = sorted(T,reverse = True)
counter = 0
for i in range(len(S)) :
    if S[i] > T[i] :
        print("No")
        break
    elif S[i] < T[i] :
        print("Yes")
        break
    else :
        counter += 1
    if counter == len(S) :
        if len(S) >= len(T) :
            print("No")
            break
        else :
            print("Yes")
            break
            

Fixed submission:
s = input()
t = input()
Alphabet = list(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
)

flag = 0
S = sorted(s)
T = sorted(t,reverse = True)
for i in range(min(len(S),len(T))) :
    if S[i] == T[i] :
        flag += 1
    else :
        for j in range(len(Alphabet)) :
            if S[i] == Alphabet[j] :
                print("Yes")
                flag += -10000
                break
            elif T[i] == Alphabet[j] :
                print("No")
                flag += -10000
                break
            else :
                continue
        break
    
if flag == min(len(S),len(T)) :
    if len(S) >= len(T) :
        print("No")
    elif s != t :
        print("Yes")
    else :
        print("No")
#print(Alphabet)

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
Alphabet = []
Alphabet.append("a")
Alphabet.append("b")
Alphabet.append("c")
Alphabet.append("d")
Alphabet.append("e")
Alphabet.append("f")
Alphabet.append("g")
Alphabet.append("h")
Alphabet.append("i")
Alphabet.append("j")
Alphabet.append("k")
Alphabet.append("l")
Alphabet.append("m")
Alphabet.append("n")
Alphabet.append("o")
Alphabet.append("p")
Alphabet.append("q")
Alphabet.append("r")
Alphabet.append("s")
Alphabet.append("t")
Alphabet.append("u")
Alphabet.append("v")
Alphabet.append("w")
Alphabet.append("x")
Alphabet.append("y")
Alphabet.append("z")
flag = 0
S = sorted(s)
T = sorted(t,reverse = True)
for i in range(len(S)) :
    if S[i] == T[i] :
        flag += 1
    else :
        for j in range(len(Alphabet)) :
            if S[i] == Alphabet[j] :
                print("Yes")
                flag += -10000
                break
            elif T[i] == Alphabet[j] :
                print("No")
                flag += -10000
                break
            else :
                continue
        break
if flag == len(S) :
    if s != t :
        print("Yes")
    else :
        print("No")


Fixed submission:
s = input()
t = input()
Alphabet = list(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
)

flag = 0
S = sorted(s)
T = sorted(t,reverse = True)
for i in range(min(len(S),len(T))) :
    if S[i] == T[i] :
        flag += 1
    else :
        for j in range(len(Alphabet)) :
            if S[i] == Alphabet[j] :
                print("Yes")
                flag += -10000
                break
            elif T[i] == Alphabet[j] :
                print("No")
                flag += -10000
                break
            else :
                continue
        break
    
if flag == min(len(S),len(T)) :
    if len(S) >= len(T) :
        print("No")
    elif s != t :
        print("Yes")
    else :
        print("No")
#print(Alphabet)