-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWINNERR
54 lines (49 loc) · 989 Bytes
/
WINNERR
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t>0)
{
int max1=0,max2=0;
int a[]=new int[2];
for(int i=0;i<2;i++)
{
a[i]=sc.nextInt();
}
int a2[]=new int[2];
for(int i=0;i<2;i++)
{
a2[i]=sc.nextInt();
}
if(a[0]<a[1])
{
max1=a[1];
}
else
max1=a[0];
if(a2[0]<a2[1])
{
max2=a2[1];
}
else
max2=a2[0];
if(max1>max2)
{
System.out.println("Q");
}
else if(max1<max2)
System.out.println("P");
else
System.out.println("TIE");
t--;
}
}
}