import java.io.*;
import java.util.*;

public class TestsGen {
	static int testcount = 0;

	static Random random = new Random(36498732);
	
	static int MAXN = (int) 1e6;

	static void write() throws IOException {
		PrintWriter out = new PrintWriter(String.format("%02d", ++testcount));
		System.out.println("Generating test #" + testcount);

		out.close();
	}

	static void writeEq(int n, int m) throws IOException {
		PrintWriter out = new PrintWriter(String.format("%02d", ++testcount));
		System.out.println("Generating test #" + testcount);
		int[] a = new int[26];
		for (int i = 0; i < m; i++) {
			a[random.nextInt(26)] += n / m;
		}
		for (int i = 0; i < 25; i++) {
			out.print(a[i] + " ");
		}
		out.println(a[25]);
		out.close();
	}

	static void writePal(int n, int pal) throws IOException {
		PrintWriter out = new PrintWriter(String.format("%02d", ++testcount));
		System.out.println("Generating test #" + testcount);
		int l = n;
		for (int i = 0; i < pal; i++) {
			l--;
			l /= 2;
		}
		int[] a = new int[26];
		int s = 0;
		for (int i = 0; i < l; i++) {
			a[random.nextInt(26)]++;
			s++;
		}
		for (int j = 0; j < pal; j++) {
			for (int i = 0; i < 26; i++) {
				a[i] *= 2;
			}
			s *= 2;
			if (s < n) {
				a[random.nextInt(26)]++;
				s++;
			}
		}
		for (int i = 0; i < 25; i++) {
			out.print(a[i] + " ");
		}
		out.println(a[25]);
		out.close();
	}

	static void writeRand(int n, int m) throws IOException {
		PrintWriter out = new PrintWriter(String.format("%02d", ++testcount));
		System.out.println("Generating test #" + testcount);
		int[] a = new int[26];
		int s = 0;
		for (int i = 0; i < 26; i++) {
			a[i] = random.nextInt(Math.min(m, n - s + 1));
			s += a[i];
		}
		for (int i = 0; i < 25; i++) {
			out.print(a[i] + " ");
		}
		out.println(a[25]);
		out.close();
	}

	static void writeMaxPal(int n, double prob) throws IOException {
		PrintWriter out = new PrintWriter(String.format("%02d", ++testcount));
		System.out.println("Generating test #" + testcount);
		int[] a = new int[26];
		a[random.nextInt(26)]++;
		int s = 1;
		while (2 * s <= n) {
			for (int i = 0; i < 26; i++) {
				a[i] *= 2;
			}
			s *= 2;
			if (s < n && random.nextDouble() < prob) {
				a[random.nextInt(26)]++;
				s++;
			}
		}
		for (int i = 0; i < 25; i++) {
			out.print(a[i] + " ");
		}
		out.println(a[25]);
		out.close();
	}

	public static void main(String[] args) throws IOException {
		while (new File(String.format("%02d.t", testcount + 1)).exists()) {
			testcount++;
		}
		writeMaxPal(1000, 0.5);
		writeMaxPal(1000, 0);
		writeMaxPal(1000, 1);
		writeRand(1000, 1000 / 26);
		writePal(100, 3);
		
		writePal(100, 1);
		writePal(1000, 9);
		writeEq(100, 25);
		writePal(MAXN, 10);
		writeMaxPal(MAXN, 0.7);
		
		writeMaxPal(MAXN, 0.5);
		writeMaxPal(MAXN, 0.5);
		writeMaxPal(MAXN, 0.3);
		writeMaxPal(MAXN, 1);
		writeRand(MAXN, MAXN / 26);
		
		writePal(MAXN, 1);
		writePal(MAXN, 3);
		writePal(MAXN, 5);
		writePal(MAXN, 7);
		writePal(MAXN, 19);
		
		writeEq(MAXN, 1);
		writeEq(MAXN, 3);
		writeMaxPal(MAXN / 10, 0.5);
		writePal(MAXN / 10, 3);
		writeMaxPal(MAXN / 10, 0.7);
	}

}
