SB = input() N = int(input()) SA = input() if SB.count("x") != SA.count("x"): print("SUCCESS") exit() if N == 0 and SB != SA: print("SUCCESS") exit() if N == 2: print("FAILURE") exit() if N == 1: count = 0 for i in range(2): if SB[i:i+2] != SA[i:i+2]: count += 1 if count == 2: print("SUCCESS") exit() print("FAILURE")