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

int main() {
	int n, q;
	cin >> n;
	vector<int> a(n);
	for (int& i : a) cin >> i;
	cin >> q;
	for (int i = 0; i < q; ++i) {
		int b, e, t;
		cin >> b >> e >> t;
		for (int i = 0; i < e - b; ++i) swap(a[b + i], a[t + i]);
	}
	cout << a[0];
	for (int i = 1; i < n; ++i) cout << ' ' << a[i];
	cout << endl;
}
