"What do you know about happiness?" — Yoda 
Chef is happy only if three conditions hold:
- Chef finished cooking a delicious meal
- Chef got AC for a programming problem with an almost correct code
- Chef got a new problem with a sequence of integers
Today, all three conditions are satisfied. Chef would like you to feel his happiness and provide him with a solution for this new problem with a sequence of integers. The problem is as follows.
You are given a sequence $A_1, A_2, \dots, A_N$. You need to determine if it is possible to choose two indices $i$ and $j$ such that $A_i \neq A_j$, but $A_{A_i}$ = $A_{A_j}$. (If it was possible, Chef would be truly happy.)

-----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 line of each test case contains a single integer $N$.
- The second line contains $N$ space-separated integers $A_1, A_2, \ldots, A_N$.

-----Output-----
For each test case, print a single line containing the string "Truly Happy" if it is possible to choose required indices or "Poor Chef" otherwise.

-----Constraints-----
- $1 \le T \le 1,000$
- $1 \le N \le 10^5$
- $1 \le A_i \le N$ for each valid $i$
- the sum of $N$ over all test cases does not exceed $2 \cdot 10^5$

-----Subtasks-----
Subtask #1 (27 points): $1 \le N \le 1,000$
Subtask #2 (73 points): original constraints

-----Example Input-----
4
4
1 1 2 3
4
2 1 3 3
5
5 4 4 3 1
5
3 2 1 1 4

-----Example Output-----
Truly Happy
Poor Chef
Poor Chef
Truly Happy

-----Explanation-----
Example case 1: Chef is truly happy because $A_{A_3} = A_{A_1}$ and $A_3 \neq A_1$.
Example case 2: There is no pair of indices which would make Chef truly happy. For instance, $A_{A_3} = A_{A_4}$, but $A_3 = A_4$,

Difficulty: interview

Starter code:

Solutions:
# cook your dish here

t=int(input())

for i in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 d={}
 for i in range(n):
  if a[i]-1 not in d:
   d[a[i]-1]=[i]
  else:
   d[a[i]-1].append(i)
 ans=False
 d1={}
 
 for i in d:
  if ans==True:
   break
  for j in d:
   if i!=j:
    if a[i]==a[j] and i!=j:
     ans=True
     break
 if ans==True:
  print('Truly Happy')
 else:
  print('Poor Chef')


# cook your dish here

t=int(input())

for i in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 d={}
 for i in range(n):
  if a[i]-1 not in d:
   d[a[i]-1]=[i]
  else:
   d[a[i]-1].append(i)
 ans=False
 d1={}
 for i in range(len(a)):
  d1[i]=a[i]
 for i in d:
  if ans==True:
   break
  for j in d:
   if i!=j:
    if d1[i]==d1[j] and i!=j:
     ans=True
     break
 if ans==True:
  print('Truly Happy')
 else:
  print('Poor Chef')


# cook your dish here

t=int(input())

for i in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 d={}
 for i in range(n):
  if a[i]-1 not in d:
   d[a[i]-1]=[i]
  else:
   d[a[i]-1].append(i)
 ans=False
 for i in d:
  if ans==True:
   break
  for j in d:
   if i!=j:
    if a[i]==a[j] and i!=j:
     ans=True
     break
 if ans==True:
  print('Truly Happy')
 else:
  print('Poor Chef')


# cook your dish here

t=int(input())

for i in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 d={}
 for i in range(n):
  if a[i]-1 not in d:
   d[a[i]-1]=[i]
  else:
   d[a[i]-1].append(i)
 ans=False
 for i in d:
  if ans==True:
   break
  for j in d:
   if ans==True:
    break
   if i!=j:
    if a[i]==a[j] and i!=j:
     
     ans=True
 if ans==True:
  print('Truly Happy')
 else:
  print('Poor Chef')


# cook your dish here
t = int(input())
for _ in range(t):
 n = int(input())
 arr = list(map(int, input().split()))
 seti1 = set(arr)
 l = [arr[i-1] for i in arr]
 seti2 = set(l)
 if len(seti1)<=len(seti2):
  print("Poor Chef")
 else:
  print("Truly Happy")
  
  
 
 



for _ in range(int(input())):
 n=int(input())
 l=list(map(int,input().split()))
 ln1=len(set(l))
 l1=[]
 for i in l:
  l1.append(l[i-1])
 ln2=len(set(l1))
 if(ln1==ln2):
  print("Poor Chef")
 else:
  print("Truly Happy")


for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 ans="Poor Chef"
 sa=set(a)
 l=[a[i-1] for i in a]
 sb=set(l)
 if len(sa)>len(sb):
  ans="Truly Happy"
 print(ans)

# cook your dish here
def __starting_point():
 t = int(input())
 for q in range(t):
  n = int(input())
  l = list(map(int,input().split()))
  
  count = 0
  for i in range(n-1):
   for j in range(i+1,n):
    if l[i]!=l[j]:
     if l[l[i]-1]==l[l[j]-1]:
      count += 1
      break
  if count==0:
   print('Poor Chef')
  else :
   print('Truly Happy')

__starting_point()

for _ in range(int(input())):
 n=int(input())
 l=list(map(int,input().split()))
 ans="Poor Chef"
 for i in range(n):
  for j in range(i+1,n):
   if l[i]==l[j]:
    if i+1 in l and j+1 in l:
     ans="Truly Happy"
 print(ans)


for _ in range(int(input())):
 a = int(input())
 array = list(map(int,input().split()))
 common = list()
 for x in array:
  if array.count(x)>1:
   common.append(x)
 
 if len(common)==0:
  print("Poor Chef")
  continue
 
 ind = dict()
 flag = 0
 for x in common:
  if x not in ind:
   ind[x]=list()
  for y in range(len(array)):
   if array[y]==x:
    ind[x].append(y+1)
  lis = ind[x]
  for m in lis:
   for n in lis:
    if m!=n and m in array and n in array:
     print("Truly Happy")
     flag = 1
     break
   if flag == 1:
    break
  if flag == 1:
    break
 
 else:
  if flag == 0:
   print("Poor Chef") 


for _ in range(int(input())):
 a = int(input())
 array = list(map(int,input().split()))
 common = list()
 for x in array:
  if array.count(x)>1:
   common.append(x)
 
 if len(common)==0:
  print("Poor Chef")
  continue
 
 ind = dict()
 for x in common:
  if x not in ind:
   ind[x]=list()
  for y in range(len(array)):
   if array[y]==x:
    ind[x].append(y+1)
   
 flag = 0
 for x in ind:
  lis = ind[x]
  for m in lis:
   for n in lis:
    if m!=n and m in array and n in array:
     print("Truly Happy")
     flag = 1
     break
   if flag == 1:
    break
  if flag == 1:
   break
 else:
  if flag == 0:
   print("Poor Chef")
     


# cook your dish here

def solve(A,n):
 for i in range(n):
  for j in range(n):
   if i != j:
    if A[i] == A[j]:
     if i+1 in A and j+1 in A:
      return True
 return False



 

try:
 T = int(input())
 for l in range(T):
  
  n = int(input())
  path = [int(i) for i in input().strip().split(" ")]
  if solve(path,n):
   print("Truly Happy")
  else:
   print("Poor Chef")
   
      
  
   
  
except EOFError:
 pass

   
  


# cook your dish here
t = int(input())
while t != 0:
 n = int(input())
 a = list(map(int, input().split()))[:n]
 happy = False 
 for i in range(n-1):
  for j in range(i+1, n):
   if a[i] != a[j]:
    k, r = a[i], a[j]
    if a[k-1] == a[r-1]:
     happy = True
     break
 if happy == True:
  print('Truly Happy')
 else:
  print('Poor Chef')
 t -= 1

try:
 t=int(input())
 for i in range(t):
  n=int(input())
  z=0
  a=[int(j) for j in input().split(" ")]
  # print(a)
  for k in range(n-1):
   # print("a")
   for x in range(k+1,n):
    #print(a[k],a[x])
    if a[k]!=a[x] :
     if a[a[k]-1]==a[a[x]-1] :
      print("Truly Happy")
      # print("c")
      z=1
      break
   if z==1:
    break
   
  if z==0:
   #print("e")
   print("Poor Chef")
  #print("................................."
except:
 pass

# cook your dish here
t = int(input())
for _ in range(t):
 N = int(input())
 dict1 = {}
 flag = False
 S = [int(x) for x in input().split()]
 for i in range(N):
  if S[i] in dict1.keys():
   dict1[S[i]].append(i+1)
  else:
   dict1[S[i]] = [i+1]
 for key,val in dict1.items():
  if len(val) == 1:
   continue
  count = 0
  for e in val:
   if e in dict1.keys():
    count += 1
   if count == 2:
    flag = True
    break
  if flag == True:
   break
 if flag == True:
  print("Truly Happy")
 else:
  print("Poor Chef")

# cook your dish here
t = int(input())
for h in range(t):
 l = int(input())
 li = list(map(int,input().split()))
 li.insert(0,0)
 status = True
 for i in range(1,len(li)):
  for j in range(1,len(li)):
   if i!=j and li[i]!=li[j]:
    if li[li[i]] == li[li[j]]:
     print("Truly Happy")
     status = False
     break
  if not status:
   break
 if status:
  print("Poor Chef")

T = int(input())
for i in range(T):
 N = int(input())
 seq = [int(s) for s in input().split()]
 ans = 0
 for i in range(len(seq)):
  a = seq[i]
  c = seq[a-1]
  for j in range(i+1, len(seq)):
   b = seq[j]
   d = seq[b-1]
   if(a!=b and c==d):
    ans = 1
    break
  if(ans == 1):
   break
 if(ans == 1):
  print("Truly Happy")
 else:
  print("Poor Chef")

t=int(input())
while t>0:
 n=int(input())
 a=list(map(int,input().split(' ')))
 d={}
 k={}
 for i in a:
  k[i]=1
 flag=0
 for i in range(len(a)):
  if d.get(a[i],0)==0:
   d[a[i]]=[i+1]
  else:
   d[a[i]].append(i+1)
 
 for i in list(d.keys()):
  c=0
  for j in d[i]:
   if k.get(j,0)==1:
    c+=1
  if c>=2:
   flag=1
   break
 if flag==1:
  print('Truly Happy')
 else:
  print('Poor Chef')
 t-=1


for _ in range(int(input())):
 n = int(input())
 arr = list(map(int,input().split()))
 A = set(arr)
 B = set(arr[i-1] for i in A)
 if A == B:
  print("Poor Chef")
 else:
  print("Truly Happy")

for _ in range(int(input())):
 n = int(input())
 arr = list(map(int,input().split()))
 status = False
 if n == 1:
  print("Poor Chef")
 else:
  for i in range(n):
   a = arr[i]
   for j in range(i+1,n):
    b = arr[j]
    if (a != b) and (arr[a-1] == arr[b-1]):
     status = True
     break
   if status == True:
    break
  if status == True:
   print("Truly Happy")
  else:
   print("Poor Chef")

for _ in range(int(input())):
 n = int(input())
 arr = list(map(int,input().split()))
 status = False
 for i in range(n):
  a = arr[i]
  for j in range(i+1,n):
   b = arr[j]
   if (a != b) and (arr[a-1] == arr[b-1]):
    status = True
    break
  if status == True:
   break
 if status == True:
  print("Truly Happy")
 else:
  print("Poor Chef")

from collections import defaultdict
x=int(input())
for __ in range(x):
 n=int(input())
 a=list(map(int,input().split()))
 d=defaultdict(list)
 for i in range(n):
  d[a[i]].append(i)
 b=set(a)
 for i in b:
  c=0
  if len(d[i])>1:
   for j in d[i]:
    if len(d[j+1])>0:
     c+=1
    if c==2:
     break
  if c==2:
   break
 if c==2:
  print("Truly Happy")
 else:
  print("Poor Chef")

from collections import defaultdict
t=int(input())
while t:
 t-=1
 n=int(input())
 a=list(map(int,input().split()))
 dd=defaultdict(list)
 boo=False
 se=set(a)
 for i in range(len(a)):
  if (a[i] in se and a[a[i]-1] in dd ):
   for j in dd[a[a[i]-1]]:
    if a[i]!=j:
     boo=True
     break
  if boo:
   break
    

  dd[a[a[i]-1]].append(a[i])
 if boo:
  print('Truly Happy')
 else:
  print('Poor Chef')

# cook your dish here
for i in range(int(input())):
 c=0
 n=int(input())
 a=list(map(int,input().split()))
 for i in range(len(a)):
  for j in range(len(a)):
   try:
    if a[i]!=a[j] and a[a[i]-1]==a[a[j]-1]:
     c+=1
    else:
     pass
   except:
    pass
 if c==0:
  print('Poor Chef')
 else:
  print('Truly Happy')