#!/usr/bin/ruby A=gets.chomp N=gets.to_i B=gets.chomp puts A.count('o')!=B.count('o') ? :SUCCESS : N>1 ? :FAILURE : N==0 ? A==B ? :FAILURE : :SUCCESS : N==1 && (A[1]+A[0]+A[2]==B || A[0]+A[2]+A[1]==B) ? :FAILURE : :SUCCESS