// using * saves typing import java.util.*; import java.io.*; public class Cheapest { public static void main(String[] args) { // in and out can be typed faster than input and output Scanner in = new Scanner(System.in); PrintStream out = System.out; // N is a constant but typing final takes type int N = in.nextInt(); // read the end of line in.nextLine(); // for each test case for (int n = 0; n < N; n++) { // here descriptive variable names are used here to ensure that we get the algorithm right double price = in.nextDouble(); boolean cheapest = true; // during contests we do not care about magic numbers for (int j = 0; j < 10; j++) { cheapest = cheapest && price < in.nextDouble(); } // read the end of line in.nextLine(); out.println(cheapest); } } }