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

public class gen_basestring implements Runnable {
	public static void main(String[] args) {
		if (args.length < 1) {
			for (I = 1; (new File(getName(I) + ".t")).exists(); I++)
				;
		} else {
			I = Integer.parseInt(args[0]);
		}
		new Thread(new gen_basestring()).start();
	}

	PrintWriter out;

	Random rand = new Random(6439586L);

	static int I;

	static String getName(int i) {
		return ((i < 10) ? "0" : "") + i;
	}

	void open() {
		try {
			System.out.println("Generating test " + I);
			out = new PrintWriter(getName(I));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}

	void close() {
		out.close();
		I++;
	}

	final String ALPHA = "abcdefghijklmnopqrstuvwxyz";

	String randString(int len, String alpha) {
		StringBuilder ans = new StringBuilder();
		int k = alpha.length();
		for (int i = 0; i < len; i++) {
			ans.append(alpha.charAt(rand.nextInt(k)));
		}
		return ans.toString();
	}

	long rand(long l, long r) {
		return l + (rand.nextLong() >>> 1) % (r - l + 1);
	}

	int rand(int l, int r) {
		return l + rand.nextInt(r - l + 1);
	}

	String pow(String a, int n, double sp) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < a.length(); ++j) {
				if (rand.nextDouble() < sp) {
					sb.append((char)rand('a', 'z'));
				} else {
					sb.append(a.charAt(j));
				}
			}			
		}
		return sb.toString();
	}
	
	void genTest(int q, int i, int j, int as, double sp) {
		open();
		String s = randString(q, ALPHA.substring(0, as));		
		out.println(pow(s, i, sp));
		out.println(pow(s, j, sp));
		close();
	}
	
	final int MAX = 1000000;
	
	public void solve() throws IOException {
		for (int i = 0; i < 5; ++i) {
			genTest(rand(1, 5), rand(1, 5), rand(1, 5), 3, 0);
		}
		for (int i = 0; i < 5; ++i) {
			genTest(rand(1, 5), rand(1, 5), rand(1, 5), 3, .1);
		}
		for (int i = 0; i < 5; ++i) {
			genTest(rand(1, 5), rand(1, 5), rand(1, 5), 3, .5);
		}
		
		for (int f = 0; f < 10; ++f) {
			int k = rand(1, MAX);
			int i = rand(Math.max(1, MAX / 2 / k), MAX / k);
			int j = rand(Math.max(1, MAX / 2 / k), MAX / k);
			genTest(k, i, j, 26, .0005 * (f % 3));
		}
		
		genTest(MAX, 1, 1, 26, 0);
		genTest(MAX, 1, 1, 26, 1);
	}
	
	void myAssert(boolean e) {
		if (!e) {
			throw new Error("Assertion failed");
		}
	}

	public void run() {
		try {
			solve();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}
}