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

int main(){

    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; ++i){
        cin >> a[i];
    }

    int q;
    cin >> q;
    for(int i = 0; i < q; ++i){
        int b, e, t;
        cin >> b >> e >> t;
        swap_ranges(a.begin() + b, a.begin() + e, a.begin() + t);
    }

    for(int i = 0; i < a.size(); ++i){
        if(i){
            cout << " ";
        }
        cout << a[i];
    }
    cout << endl;

    return 0;
}
