public static void main(String[] args) {
		Random gen = new Random();
		int N;
		if (args.length == 1) {
			N = Integer.valueOf(args[0]);
		} else {
			N = gen.nextInt(50) + 1;
		}
		int[][] A = new int[N][N];
		int x = 1;
		for (int i = 0; i < N; ++i) {
			for (int j = 0; j < N; ++j) {
				A[i][j] = x++;
			}
		}
		print_matrix_in_spiral_order(A);
	}