60救救瓦!!!#1,#2,#5,#7 WA
#include<iostream>
using namespace std;
int a,b,c,o,t,th;
int main(){
cin>>a>>b>>c>>o>>t>>th;
if(a>=60&&c>=60||a>=60&&b>=60||b>=60&&c>=60) cout<<"PASS"<<endl;
else cout<<"FAIL";
if((a*o+b*t+c*th)/(o+t+th)*1.0>=60) cout<<"PASS";
else cout<<"FAIL";
return 0;
}