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