#include <iostream>
#include <string.h>
#include <vector>
#include <stdio.h>

using namespace std;

int main(void) {

	int n, m, x, y, z;
    vector<string> inputs;
    string read;
    while (1){
        getline(cin, read);
        if(!read.compare("0 0"))
            break;
        inputs.push_back(read);
    }
    sscanf(inputs[0].c_str(), "%d %d", &n, &m);
    sscanf(inputs[1].c_str(), "%d %d %d", &x, &y, &z);

    cout<<n<<" "<<m<<endl;
    cout<<x<<" "<<y<<" "<<z<<endl;
    
    return 0;
}
