#!/usr/bin/env python #coding:utf8 def read(): return list(raw_input()), input(), list(raw_input()) def work((S, N, T)): if S.count('o') != T.count('o') or S.count('x') != T.count('x'): print "SUCCESS" return cost = 0 for i in range(len(S)): for j in range(i + 1, len(S)): if S[i] != T[i] and S[j] != T[j]: cost = abs(i - j) if cost > N or (S == T and N == 1 and S[0] != S[1] and S[0] == S[2]): print "SUCCESS" else: print "FAILURE" if __name__ == "__main__": work(read())