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(100) + 1;
			}

			List<Integer> A = rand_vector(n);

			int pivot_index = gen.nextInt(A.size());
			int pivot = A.get(pivot_index);

			dutch_flag_partition(A, pivot_index);

			int i = 0;
			while (i < A.size() && A.get(i) < pivot) {
				System.out.print(A.get(i) + " ");
				++i;
			}
			while (i < A.size() && A.get(i) == pivot) {
				System.out.print(A.get(i) + " ");
				++i;
			}
			while (i < A.size() && A.get(i) > pivot) {
				System.out.print(A.get(i) + " ");
				++i;
			}

			System.out.println();

			assert (i == A.size());
		}

	}