#include <iostream>

using namespace std;

int main(){
	int w, n;
	int s[w];

	cin >> w >> n;

	for(int i=0; i<n; i++){
		int a, b;
		int c, d;
		cin >> a >> b;

		s[a] = c;
		s[b] = d;

		s[a] = d;
		s[b] = c;
	}

	for(int i=0; i<w; i++){
		cout << s[i];
	}
	cout << endl;
}