#include using namespace std; #define int long long struct Info { int x1, y1; int x2, y2; }; int n, m; int pos[201010]; Info t[201010]; int ans[201010]; signed main() { cin.tie(0); ios::sync_with_stdio(0); cin >> n >> m; for (int i = 1; i <= n; i++) pos[i] = i; for (int id = 1; id <= m; id++) { cin >> t[id].x1 >> t[id].y1 >> t[id].x2 >> t[id].y2; } sort(t + 1, t + 1 + m, [](Info q, Info w) { return q.y1 < w.y1; }); for (int id = 1; id <= m; id++) { swap(pos[t[id].x1], pos[t[id].x2]); } for (int i = 1; i <= n; i++) { ans[pos[i]] = i; } for (int i = 1; i <= n; i++) { cout << ans[i] << '\n'; } return 0; }