a,b;main(s){gets(&a);gets(&s);gets(&b);a=!puts((a-b)%5|(s-48?s-49?0:a%7*b%7==1:a-b)?"SUCCESS":"FAILURE");}