package com.javarush.task.task18.task1818;

/*
Два в одном
*/

import java.io.*;

public class Solution {
    public static void main(String[] args)throws IOException, FileNotFoundException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        FileOutputStream file1 = new FileOutputStream(reader.readLine(),true);
        FileInputStream file2 = new FileInputStream(reader.readLine());
        FileInputStream file3 = new FileInputStream(reader.readLine());
        reader.close();
        byte[] f2 = new byte[file2.available()];
        byte[] f3 = new byte[file3.available()];
        int count2 = file2.read(f2);
        int count3 = file2.read(f3);
        file1.write(f2,0, f2.length);
        file2.close();
        file1.write(f3,0, f3.length);
        file3.close();
        file1.close();
    }
}