a[2],s,i;main(k){for(;k=~getchar();k+11?a[i]=a[i]<<1|k&1:scanf("%d\n",&s,i++));i=!puts(s|*a==a[1]&&s-1|*a^a[1]^5?"FAILURE":"SUCCESS");}