import java.io.*;
import java.util.StringTokenizer;

class Main {
	public static void main(String args[]) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);

		try {
			int w = Integer.parseInt(br.readLine());
			int n = Integer.parseInt(br.readLine());
			int amida[] = new int[w];
			for (int i=0;i<w;i++) amida[i] = i+1;
			for (int i=0;i<n;i++) {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			}
			for (int i=0;i<w;i++) System.out.println(amida[i]);
		} catch (Exception e) {
			System.out.println("Exception!");
		}
	}
} import java.io.*; io.* java import java.util.StringTokenizer; StringTokenizer java.util class Main {
	public static void main(String args[]) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);

		try {
			int w = Integer.parseInt(br.readLine());
			int n = Integer.parseInt(br.readLine());
			int amida[] = new int[w];
			for (int i=0;i<w;i++) amida[i] = i+1;
			for (int i=0;i<n;i++) {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			}
			for (int i=0;i<w;i++) System.out.println(amida[i]);
		} catch (Exception e) {
			System.out.println("Exception!");
		}
	}
} Main public static void main(String args[]) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);

		try {
			int w = Integer.parseInt(br.readLine());
			int n = Integer.parseInt(br.readLine());
			int amida[] = new int[w];
			for (int i=0;i<w;i++) amida[i] = i+1;
			for (int i=0;i<n;i++) {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			}
			for (int i=0;i<w;i++) System.out.println(amida[i]);
		} catch (Exception e) {
			System.out.println("Exception!");
		}
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);

		try {
			int w = Integer.parseInt(br.readLine());
			int n = Integer.parseInt(br.readLine());
			int amida[] = new int[w];
			for (int i=0;i<w;i++) amida[i] = i+1;
			for (int i=0;i<n;i++) {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			}
			for (int i=0;i<w;i++) System.out.println(amida[i]);
		} catch (Exception e) {
			System.out.println("Exception!");
		}
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) try {
			int w = Integer.parseInt(br.readLine());
			int n = Integer.parseInt(br.readLine());
			int amida[] = new int[w];
			for (int i=0;i<w;i++) amida[i] = i+1;
			for (int i=0;i<n;i++) {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			}
			for (int i=0;i<w;i++) System.out.println(amida[i]);
		} catch (Exception e) {
			System.out.println("Exception!");
		} catch (Exception e) {
			System.out.println("Exception!");
		} Exception e {
			System.out.println("Exception!");
		} System.out.println("Exception!") System.out.println System.out System System.out "Exception!" {
			int w = Integer.parseInt(br.readLine());
			int n = Integer.parseInt(br.readLine());
			int amida[] = new int[w];
			for (int i=0;i<w;i++) amida[i] = i+1;
			for (int i=0;i<n;i++) {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			}
			for (int i=0;i<w;i++) System.out.println(amida[i]);
		} int w = Integer.parseInt(br.readLine()); w Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int amida[] = new int[w]; amida new int[w] w for (int i=0;i<w;i++) amida[i] = i+1; int i=0; int i=0; i 0 i<w i w i++ i++ i amida[i] = i+1; amida[i] = i+1 amida[i] amida i i+1 i 1 for (int i=0;i<n;i++) {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			} int i=0; int i=0; i 0 i<n i n i++ i++ i {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			} {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			} StringTokenizer st = new StringTokenizer(br.readLine(),","); st new StringTokenizer(br.readLine(),",") int a = Integer.parseInt(st.nextToken()); a Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int b = Integer.parseInt(st.nextToken()); b Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st amida[a-1] = amida[a-1]^amida[b-1] amida[a-1] amida a-1 a 1 amida[a-1]^amida[b-1] amida[a-1] amida a-1 a 1 amida[b-1] amida b-1 b 1 amida[b-1] = amida[a-1]^amida[b-1] amida[b-1] amida b-1 b 1 amida[a-1]^amida[b-1] amida[a-1] amida a-1 a 1 amida[b-1] amida b-1 b 1 amida[a-1] = amida[a-1]^amida[b-1] amida[a-1] amida a-1 a 1 amida[a-1]^amida[b-1] amida[a-1] amida a-1 a 1 amida[b-1] amida b-1 b 1 for (int i=0;i<w;i++) System.out.println(amida[i]); int i=0; int i=0; i 0 i<w i w i++ i++ i System.out.println(amida[i]); System.out.println(amida[i]) System.out.println System.out System System.out amida[i] amida i String args[] args
import java.io.*;
import java.util.StringTokenizer;

class Main {
	public static void main(String args[]) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);

		try {
			int w = Integer.parseInt(br.readLine());
			int n = Integer.parseInt(br.readLine());
			int amida[] = new int[w];
			for (int i=0;i<w;i++) amida[i] = i+1;
			for (int i=0;i<n;i++) {
				StringTokenizer st = new StringTokenizer(br.readLine(),",");
				int a = Integer.parseInt(st.nextToken());
				int b = Integer.parseInt(st.nextToken());
				amida[a-1] = amida[a-1]^amida[b-1];
				amida[b-1] = amida[a-1]^amida[b-1];
				amida[a-1] = amida[a-1]^amida[b-1];
			}
			for (int i=0;i<w;i++) System.out.println(amida[i]);
		} catch (Exception e) {
			System.out.println("Exception!");
		}
	}
}