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