#!/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 (N - cost) % 2 == 1: print "SUCCESS" else: print "FAILURE" if __name__ == "__main__": work(read())