public static void main(String[] args) {
		Random gen = new Random();
		for (int times = 0; times < 1000; ++times) {
			int n;
			if (args.length == 1) {
				n = Integer.valueOf(args[0]);
			} else {
				n = gen.nextInt(10000) + 1;
			}
			int[] G = new int[n], D = new int[n];
			int sum = 0;
			for (int i = 0; i < n; ++i) {
				int x = gen.nextInt(200) + 1;
				sum += x;
				G[i] = x;
			}
			sum -= n;
			for (int i = 0; i < n; ++i) {
				int x = 0;
				if (sum > 0) {
					x = gen.nextInt(sum) + 1;
				}
				D[i] = x + 1;
				sum -= x;
			}
			D[D.length - 1] += sum;

			/*
			 * simplePrint(G); System.out.println();
			 * 
			 * simplePrint(D); System.out.println();
			 */
			int c = find_start_city(G, D);
			System.out.println("start city = " + c);
			check_ans(G, D, c);
		}
	}