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

public class TestGen implements Runnable {

	public static void main(String args[]) {
		new Thread(new TestGen()).start();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;

	@Override
	public void run() {
		for (int i = 1; i <= 10; i++) {
			try {
				Locale.setDefault(Locale.US);
				String name = ((i < 10) ? "0" : "") + i; 
				br = new BufferedReader(new FileReader(name +  ".h"));
				out = new PrintWriter(name);
				copy();
				br.close();
				out.close();
			} catch (Exception e) {
				e.printStackTrace();
				System.exit(566);
			}
		}
	}

	private void copy() {
		out.println(nextInt() + " " + nextInt());
		while (true) {
			eof = false;
			String s = nextToken();
			if (!eof)
				out.println(s);
			else
				break;
		}
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

}