From Tallinn to Amsterdam ------------------------- Every week, Estonian Air offers five cheap flights. Each week, different flights are offered on discount. Each flight is only 50 euros. Artjom wants to fly from Tallinn to Amsterdam. However, he has only saved 100 euros. Hence, he can only afford a cheap flight from Tallinn to Amsterdam or two cheap flights that combined take him from Tallinn to Amsterdam. Every Monday morning when the ten cheap Estonian Air flights are announced on the website www.estonian-air.ee, Artjom figures out on a piece of paper whether he can travel this week to Amsterdam. Can you help him by writing a program that determines whether he can get to Amsterdam for at most 100 euro? Input ----- Your program will be tested on one or more data sets. The first line contains an integer N (1 <= N < 100), which is the number of data sets. Each data set consists of a single line. The line contains 11 integers. The first integer C (4 <= C <= 12) is the number of different cities that are origins or destinations of the cheap flights (plus Tallinn and Amsterdam). The remaining ten integers represent the five cheap flights. Each flight is represented by its origin and destination. So, the line is of the form C O1 D1 O2 D2 O3 D3 O4 D4 O5 D5 where the integer Oi (0 <= Oi < C) represents the origin of the ith cheap flight and the integer Di (0 <= Di < C) represents the destination of the ith cheap flight. By convention, 0 is Tallinn and 1 is Amsterdam. Output ------ For each data set, your program should print true if Artjom can travel from Tallinn to Amsterdam for at most 100 euros, and false otherwise. Sample input ------------ 3 6 0 1 1 2 2 3 3 4 4 5 6 5 4 4 3 3 2 2 1 1 0 4 0 2 2 0 2 1 1 2 2 3 Sample output ------------- true false true