//No.197 手品 import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No0197 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { char[] sb = in.next().toCharArray(); long n = in.nextLong(); char[] sa = in.next().toCharArray(); int cnt = 0; for (int i=0; i<3; i++) { if (sb[i] != sa[i]) cnt++; } out.println(cnt>n?"SUCCESS":"FAILURE"); } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); in.close(); out.close(); } static void trace(Object... o) { System.out.println(deepToString(o));} }