#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    
    int n;
    cin >> n;
    
    vector<int> ted(n);
    
    for(int i = 0; i < n; i++){
        cin >> ted[i];
    }
    
    for(int i = 0; i < n; i++){
        cout << ted[i] << " ";
    }
    cout << endl;
    
    for(int i = 0; i < n; i++){
        cout << ted[i] << " ";
    }
    
    return 0;
}