import java.util.*;
import java.io.*;
class h{
public static void main(String args[])throws Exception
{BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(br.readLine()),f=-1;
for(int i=0;i<n;i++)
{int a=Integer.parseInt(br.readLine());
int[] ar=new int[a+1];int max=0,m=0,t=0,g=0,ele=0;
HashMap<Integer,Integer> h=new HashMap<>();ar[0]=-1;
for(int j=1;j<a+1;j++)
{ar[j]=Integer.parseInt(br.readLine());
if(h.containsKey(ar[j]))
{int count=h.get(ar[j]);
count=count+1;h.put(ar[j],count);
max=j;g=t;ele=ar[j];f=1;
}
else{h.put(ar[j],1);m=j;if(f!=1){t++;}f=0;
}
}
m=0;int p=0;
for(int k=1;k<=a;k++)
{
if(max==ar[k]){m=k;}
if(g==ar[k]){p=k;}
}
if(p==0||m==0){System.out.println(“Poor Chef”);}
else{if(m!=0){
int r=ar[m];
System.out.println(ar[m]+""+ar[r]+""+ar[p]+""+ar[ar[p]]);
if(m!=0){
if((ar[ar[p]]==ar[ar[m]])&&(ar[p]!=ar[m])){System.out.println(1);}
else{System.out.println(0);}
}}
else{System.out.println(0);}
}}
}
}