import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Random;

public class TestsGen {

	public static void main(String[] args) {
		testsNum = 0;
		// test #1
		{
			Test.print("abacaba",
					new String[] { "cabab", "dabacaba", "aaaaaa" });
		}

		// test #2
		{
			Test.print("aaaaa", new String[] { "aa", "aaaaaa" });
		}
	}

	static int testsNum;

	static class Test {

		static void print(String t, Collection<String> s) {
			print(t, s.toArray(new String[s.size()]));
		}

		static void print(String t, String[] s) {
			++testsNum;
			System.err.println("Generating test #" + testsNum);
			PrintWriter out = null;
			try {
				out = new PrintWriter(testsNum / 10 + "" + testsNum % 10);
				out.println(t);
				out.println(s.length);
				for (String e : s) {
					out.println(e);
				}
			} catch (IOException e) {
				e.printStackTrace();
				throw new RuntimeException(e);
			} finally {
				if (out != null) {
					out.close();
				}
			}
		}
	}
}
