#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>

using namespace std;

void show_vector(const vector<int> &x) {
    for (auto item : x) {
        cout << item << " ";
    }
    cout << "\n";
}

int main() {
    std::ifstream in("input.txt");
    std::ofstream out("output.txt");
    vector<int> x, y;
    vector<vector<int>> z;
    int a;
    string s;

//1 2 3 4 5
//4 3 32
//45 645 5 675 756
//45 46 546 64 64
//5
//45 64 457 457 7
//67 67 67


    // read first line with integer array
    getline(in, s);
    istringstream x_stream(s);
    while (x_stream >> a) {
        x.push_back(a);
    }

    // read second line with integer array
    getline(in, s);
    istringstream y_stream(s);
    while (y_stream >> a) {
        y.push_back(a);
    }

    // read the rest of the file, creating vector of vectors
    getline(in, s);
    while (!in.eof()) {
        istringstream z_stream(s);
        z.emplace_back();
        while (z_stream >> a) {
            z.back().push_back(a);
        }
        getline(in, s);
    }

    // write to output.txt vector x
    for (int i = 0; i < x.size(); i++) {
        out << x[i]<< " ";
    }
    out << "\n";

    // write to output.txt vector y
    for (int i = 0; i < y.size(); i++) {
        out << y[i]<< " ";
    }

    // write to cout vector of vectors z
    for (auto row : z) {
        show_vector(row);
    }
}
