#include<bits/stdc++.h> using namespace std; long long a,b,c,d,e,f; int main(){ cin>>a>>b>>c>>d>>e>>f; if(a+b+c>=60)cout<<"PASS"<<endl; else cout<<"FAIL"<<endl; if((a*d+b*e+c*f)/(d+e+f)>=60)cout<<"PASS"; else cout<<"FAIL"; }