Mysterious Chefland… Recently, Chef realised that Discuss, the educational system of Chefland, is out of date. Therefore, he is trying to find ways to update the infrastructure in the country. One possible way is to move all materials from Discuss to Discourse.
Chef will have access to Discourse if his knowledge and power become exactly equal to $N$ and $M$ respectively. Initially, he has power $1$ and knowledge $1$.
Chef can perform actions of the following types to improve his skills:
- solve a problem — increase his knowledge by $X$
- do a push-up — increase his power by $Y$
- install ShareChat to keep in touch with friends — increase both knowledge and power by $1$
Chef can only install ShareChat at most once. The remaining actions may be performed any number of times and the actions may be performed in any order.
Help Chef find out whether it is possible to move from Discuss to Discourse.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains four space-separated integers $N$, $M$, $X$ and $Y$.

-----Output-----
For each test case, print a single line containing the string "Chefirnemo" if it is possible to reach the required knowledge and power or "Pofik" if it is impossible.

-----Constraints-----
- $1 \le T \le 1,000$
- $1 \le N, M, X, Y \le 10^9$

-----Subtasks-----
Subtask #1 (30 points): $1 \le N, M, X, Y \le 100$
Subtask #2 (70 points): original constraints

-----Example Input-----
5
2 2 1 2
11 10 5 9
11 11 5 9
12 11 5 9
1 2 1 100

-----Example Output-----
Chefirnemo
Chefirnemo
Pofik
Chefirnemo
Pofik

-----Explanation-----
Example case 2: We add $Y=9$ once to the power to get power $10$. We add $X=5$ twice to the knowledge to get knowledge $11$.
Example case 3: We can see that it is impossible to reach power $M=11$ no matter which or how many operations we do. Note that the ShareChat operation will increase both knowledge and power by $1$, and hence it will still be impossible to attain the given values of knowledge and power at the same time.
Example case 4: We can reach knowledge $11$ and power $10$ like in example case 2, the only difference is that we also use the ShareChat operation to increase both by $1$.

Difficulty: interview

Starter code:

Solutions:
t = input()
t = int(t)

for _ in range(t):
 n, m, x, y = input().split()
 n = int(n)
 m = int(m)
 x = int(x)
 y = int(y)
 n -= 1
 m -= 1
 flag = 0
 if n % x == 0 and m % y == 0:
  flag = 1
 n -= 1
 m -= 1
 if n >= 0 and m >= 0:
  if n % x == 0 and m % y == 0:
   flag = 1
 
 if flag == 1:
  print("Chefirnemo")
 else:
  print("Pofik")

# cook your dish here
test=int(input())
for _ in range(test):
 n,m,x,y=map(int,input().split())
 if (n-1)%x==0 and (m-1)%y==0:
  print("Chefirnemo")
 elif (n-2)%x==0 and (m-2)%y==0 and (n-2)>=0 and (m-2)>=0:
  print("Chefirnemo")
 else:
  print("Pofik")

#suprabhat code 
import math
t=int(input())
for q in range(t):
 n,m,x,y=map(int,input().split(" "))
 if(n==1 and m==1):
   print("Chefirnemo")
 elif(n==2 and m==2):
   print("Chefirnemo")
 elif (x==1 and n!=1 and (m-1)%y==1):
   print("Chefirnemo")
 elif (y==1 and m!=1 and (n-1)%x==1):
   print("Chefirnemo")
 elif (x==1 and y==1):
   print("Chefirnemo")
 elif(x==0 and y==0):
   print("Pofik")
 else:
  if((n-1)%x==0 and (m-1)%y==0):
   print("Chefirnemo")
  elif((n-1)%x==1 and (m-1)%y==1):
   print("Chefirnemo")
  else:
   print("Pofik")

def main():
 t = int(input())
 a_c = "Chefirnemo"
 a_n = "Pofik"
 while t:
  t -= 1
  n, m, x, y = list(map(int, input().split()))
  res = a_n
  
  if ( (n-1)%x==0) and ( (m-1)%y==0 ):
   res=a_c
  if (n-2)%x == 0 and n >= 2 and (m-2)%y == 0 and m >= 2:
   res = a_c
  print(res)

try:
 main()
except:
 pass

def main():
 t = int(input())
 
 a_c = "Chefirnemo"
 a_n = "Pofik"
 
 
 while t:
  t -= 1
  
  n, m, x, y = list(map(int, input().split()))
  
  if ((n-1)<x) and ((m-1)<y):
   print(a_n)
  else:    
   if ((n-1) % x == 0) and ((m-1) % y == 0):
    print(a_c)
    
   elif ((n-2) % x == 0) and ((m-2) % y == 0):
    print(a_c)
   else:
    print(a_n)
   

try:
 main()
except:
 pass

for _ in range(int(input())):
 n,m,x,y=map(int,input().split())
 n,m=n-1,m-1
 if((n%x==0 and m%y==0) or (n%x==1 and m%y==1)):
  print("Chefirnemo")
 elif((n>0 and x==1 and m%y==1) or (m>0 and y==1 and n%x==1)):
  print("Chefirnemo")
 else:
  print("Pofik")

t = int(input())
for _ in range(t):
 n,m,x,y = map(int,input().strip().split(" "))
 n-=1
 m-=1
 rx=n%x
 ry=m%y
 if (rx==0 and ry==0) or (rx==1 and ry==1):
  print("Chefirnemo")
 elif (x==1 and ry==1 and n>0) or (m>0 and y==1 and rx==1):
  print("Chefirnemo")
 else:
  print("Pofik")

for i in range(int(input())):
 a,b,c,d=map(int,input().split())
 a-=1
 b-=1
 if a%c==0 and b%d==0:
  print("Chefirnemo")
 elif a!=0 and b!=0 and (a-1)%c==0 and (b-1)%d==0:
  print("Chefirnemo")
 else:
  print('Pofik')

def main():
 t = int(input())
 for __ in range(t):
  n,m,x,y = list(map(int,input().split()))
  if n == m and m <= 1:
   print("Chefirnemo")
  elif ((n-1)%x == 0 and (m-1)%y == 0) :
   print("Chefirnemo")
  elif (n-2)%x == 0 and (m-2)%y == 0and min(n,m)>1:
   print("Chefirnemo")

  else:
   print("Pofik")
def __starting_point():
 main()

__starting_point()

# cook your dish here
for _ in range(int(input())):
 n,m,x,y = map(int, input().split())
 n -= 1
 m -= 1
 
 if n%x==0 and m%y==0:
  print("Chefirnemo")
 else:
  n -= 1
  m -= 1
  if n%x==0 and m%y==0:
   if n>=0 and m>=0 :
    print("Chefirnemo")
   else:
    print("Pofik")
  else:
   print("Pofik")

tc=int(input())
z=[]
for i in range(tc):
 n, m, x, y = [int(x) for x in input().split()]
 n1 = n - 1
 n2 = n - 2
 m1 = m - 1
 m2 = m - 2

 if n1%x==0 and m1%y==0:
   z.append("Chefirnemo")
 elif n2%x==0 and m2%y==0:
  if n2>=0 and m2>=0:
   z.append("Chefirnemo")
  else:
   z.append("Pofik")
 else:

   z.append("Pofik")

for i in range(tc):
 print(z[i])

t = int(input())
for _ in range(t):
 n, m, x, y = (int(x) for x in input().split())
 a = (n-1)%x == 0 and (m-1)%y == 0
 b = (n-2)%x == 0 and (m-2)%y == 0 and min(n,m)>1
 if a or b :
  print("Chefirnemo")
 else:
  print("Pofik")

# cook your dish here
for _ in range(int(input())):
 
 n,m,x,y = list(map( int, input().split() ))
 
 n= n-1
 m= m-1
 
 flag = 0
 
 if n%x == 0 and flag == 0:
  if m%y == 0 and flag == 0:
   print("Chefirnemo")
   flag = 1
   
 if n>0 and m>0:
  if (n-1)%x == 0 and (m-1)%y == 0 and flag == 0 :
   print("Chefirnemo")
   flag = 1
  
 if flag == 0:
  print("Pofik")
  


'''
##########################################
This File is submitted by SAURABH SISODIA
EMAIL ... ssisodia507@gmail.com

##########################################
'''
for _ in range(int(input())):
 n,m,x,y=map(int,input().split( ))
 k1=(n-1)//x
 k2=(m-1)//y
 if n==1 or m==1:
  if x*k1==n-1 and y*k2==m-1:
   print("Chefirnemo")
  else:
   print("Pofik")
 elif x*k1==n-1 and y*k2==m-1:
  print("Chefirnemo")
 else:
  k1=(n-2)//x
  k2=(m-2)//y
  if x*k1==n-2 and y*k2==m-2:
   print("Chefirnemo")
  else:
   print("Pofik")

# from sys import stdin

t = int(input())

for _ in range(t):
 n, m, x, y = [int(x) for x in input().split()]

 n -= 1
 m -= 1

 if (n == 0 and m == 0) or (n == 1 and m == 1):
  print('Chefirnemo')
  continue

 if n%x == 0 and m%y == 0:
  print('Chefirnemo')
  continue
 
 f = 0
 if n>0 and m>0:
  if n%x == 1 and m%y == 1:
   f = 1
   print('Chefirnemo')
  elif x == 1 and (m%y in [0, 1]):
   f = 1
   print('Chefirnemo')
  elif y == 1 and (n%x in [0, 1]):
   f = 1
   print('Chefirnemo')

 if f == 0:
  print('Pofik')


t=int(input())
for i in range(t):
 n,m,x,y=list(map(int,input().split()))
 n1=n-1 
 m1=m-1 
 if n1%x==0 and m1%y==0:
  print("Chefirnemo")
 elif (n1-1)%x==0 and (m1-1)%y==0 and n1>0 and m1>0:
  print("Chefirnemo")
 #elif 
 #elif n1==1 and m1==1:
  #  print("Chefirnemo")
 else:
  print("Pofik")

res = ["Pofik", "Chefirnemo"]
for _ in range(int(input())):
 n,m,x,y = map(int, input().split())

 if n==1 or m==1:
  print(res[(n%x == 1%x and m%y == 1%y)])
 else:
  print(res[ (n%x == 1%x and m%y == 1%y)
     or (n%x == 2%x and m%y == 2%y) ])

# cook your dish here
t = int(input())
while t>0:
 t-=1
 n,m,x,y = [int(x) for x in input().split()]
 f=0
 if m==1 and n==1:
  f=1
 elif n==2 and m==2:
  f=1
 elif (n-1)%x==0 and (m-1)%y==0 and n>=1 and m>=1: f=1
 elif n>=2 and m>=2:
  if (n-2)%x==0 and (m-2)%y==0: f=1
 if f==1: print('Chefirnemo')
 else: print('Pofik')