public static void main(String args[]) throws Throwable {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		sb.append("Lumberjacks:\n");
		for (int t=0,T=parseInt(in.readLine().trim());t++<T;) {
			StringTokenizer st=new StringTokenizer(in.readLine());
			int[] arr=new int[10];
			for(int i=0;i<10;i++)arr[i]=parseInt(st.nextToken());
			boolean ws=true;
			for(int i=1;i<10&&ws;i++)
				ws=arr[i]<arr[i-1];
			if(!ws) {
				ws=true;
				for(int i=1;i<10&&ws;i++)
					ws=arr[i]>arr[i-1];
			}
			if(ws)sb.append("Ordered\n");
			else sb.append("Unordered\n");
		}
		System.out.print(new String(sb));
	}