#197magic Sb=list(input()) N=int(input()) Sa=list(input()) ub=0 ua=0 pb=0 qb=0 pa=0 qa=0 for i in range(3): if Sb[i]=="o": Sb[i]=1 ub+=1 pb=i else: Sb[i]=0 qb=i if Sa[i]=="o": Sa[i]=1 ua+=1 pa=i else: Sa[i]=0 qa=i if ub!=ua: print("SUCCESS") else: if ub==0 or ub==3: print("FAILURE") else: if ub==2: pb=qb pa=qa d=pa-pb if d<0: d*=-1 if d>N: print ("SUCCESS") else: if d%2==N%2: print ("FAILURE") else: print ("SUCCESS")