sb = input() n = int(input()) sa = input() if n >= 2: print("FAILURE") elif n == 1: ans = set([]) ans.add(sb[0] + sb[2] + sb[1]) ans.add(sb[1] + sb[0] + sb[2]) if sa in ans: print("FAILURE") else: print("SUCCES") elif sb == sa: print("FAILURE") else: print("SUCCESS")