import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

/*
Последовательный вывод файлов
*/

public class Solution {
    public static String firstFileName;
    public static String secondFileName;

    static {

        try {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    firstFileName = reader.readLine();
    secondFileName = reader.readLine();
    } catch (IOException e) {
        e.printStackTrace();
    }
 }
    public static void main(String[] args) throws InterruptedException {
        systemOutPrintln(firstFileName);
        systemOutPrintln(secondFileName);
    }

    public static void systemOutPrintln(String fileName) throws InterruptedException {
        ReadFileInterface f = new ReadFileThread();
        f.setFileName(fileName);
        f.start();
        f.join();
        System.out.println(f.getFileContent());
    }

    public interface ReadFileInterface {

        void setFileName(String fullFileName);

        String getFileContent();

        void join() throws InterruptedException;

        void start();
    }

    public static class ReadFileThread extends Thread implements ReadFileInterface {
        String fileName1;
        String result = "";

        public void setFileName(String fullFileName) {
          fileName1 = fullFileName;
        }
        public String getFileContent() {
          return result;
        }
        @Override
        public void run() {
            try {
                BufferedReader reader2 = new BufferedReader(new FileReader(fileName1));
                while (reader2.ready()) {
                result += " ";
                result += reader2.readLine();
                }
                reader2.close();
                } catch (Exception e) {

                }
            }
        }
    }