import java.util.Scanner; public class Tejina { public static void main(String[] args) { Scanner s = new Scanner(System.in); StringBuilder be = new StringBuilder(s.next()); int N = s.nextInt(); String af = s.next(); s.close(); for(int i = 0;i < 2;i++){ if(be.charAt(i) != af.charAt(i)){ if(be.charAt(i) == af.charAt(i+1)){ N--; char c = be.charAt(i); be.deleteCharAt(i); be.insert(i+1, c); }else if(be.charAt(i) == af.charAt(2));{ N -= 2; char c = be.charAt(i); be.deleteCharAt(i); be.append(c); } } } if(N < 0 || N%2 == 1){ System.out.println("SUCCESS"); }else{ System.out.println("FAILURE"); } } }