import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in).useDelimiter("\\D");
		int ax, by, i;
		int w = sc.nextInt();
		int n = sc.nextInt();
		int[] tate = new int[w];
		for (i = 0; i < w; i++) {
			tate[i] = i + 1;
		}
		for (i = 0; i < n; i++) {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		}
		for (i = 0; i < w; i++) {
			System.out.println(tate[i]);
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in).useDelimiter("\\D");
		int ax, by, i;
		int w = sc.nextInt();
		int n = sc.nextInt();
		int[] tate = new int[w];
		for (i = 0; i < w; i++) {
			tate[i] = i + 1;
		}
		for (i = 0; i < n; i++) {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		}
		for (i = 0; i < w; i++) {
			System.out.println(tate[i]);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in).useDelimiter("\\D");
		int ax, by, i;
		int w = sc.nextInt();
		int n = sc.nextInt();
		int[] tate = new int[w];
		for (i = 0; i < w; i++) {
			tate[i] = i + 1;
		}
		for (i = 0; i < n; i++) {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		}
		for (i = 0; i < w; i++) {
			System.out.println(tate[i]);
		}
	} main {
		Scanner sc = new Scanner(System.in).useDelimiter("\\D");
		int ax, by, i;
		int w = sc.nextInt();
		int n = sc.nextInt();
		int[] tate = new int[w];
		for (i = 0; i < w; i++) {
			tate[i] = i + 1;
		}
		for (i = 0; i < n; i++) {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		}
		for (i = 0; i < w; i++) {
			System.out.println(tate[i]);
		}
	} Scanner sc = new Scanner(System.in).useDelimiter("\\D"); sc new Scanner(System.in).useDelimiter("\\D") new Scanner(System.in).useDelimiter new Scanner(System.in) "\\D" int ax ax by by i; i int w = sc.nextInt(); w sc.nextInt() sc.nextInt sc int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] tate = new int[w]; tate new int[w] w for (i = 0; i < w; i++) {
			tate[i] = i + 1;
		} i = 0; i = 0 i 0 i < w i w i++ i++ i {
			tate[i] = i + 1;
		} {
			tate[i] = i + 1;
		} tate[i] = i + 1 tate[i] tate i i + 1 i 1 for (i = 0; i < n; i++) {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		} i = 0; i = 0 i 0 i < n i n i++ i++ i {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		} {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		} ax = sc.nextInt() ax sc.nextInt() sc.nextInt sc by = sc.nextInt() by sc.nextInt() sc.nextInt sc int sub = tate[ax - 1]; sub tate[ax - 1] tate ax - 1 ax 1 tate[ax - 1] = tate[by - 1] tate[ax - 1] tate ax - 1 ax 1 tate[by - 1] tate by - 1 by 1 tate[by - 1] = sub tate[by - 1] tate by - 1 by 1 sub for (i = 0; i < w; i++) {
			System.out.println(tate[i]);
		} i = 0; i = 0 i 0 i < w i w i++ i++ i {
			System.out.println(tate[i]);
		} {
			System.out.println(tate[i]);
		} System.out.println(tate[i]) System.out.println System.out System System.out tate[i] tate i String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in).useDelimiter("\\D");
		int ax, by, i;
		int w = sc.nextInt();
		int n = sc.nextInt();
		int[] tate = new int[w];
		for (i = 0; i < w; i++) {
			tate[i] = i + 1;
		}
		for (i = 0; i < n; i++) {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		}
		for (i = 0; i < w; i++) {
			System.out.println(tate[i]);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in).useDelimiter("\\D");
		int ax, by, i;
		int w = sc.nextInt();
		int n = sc.nextInt();
		int[] tate = new int[w];
		for (i = 0; i < w; i++) {
			tate[i] = i + 1;
		}
		for (i = 0; i < n; i++) {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		}
		for (i = 0; i < w; i++) {
			System.out.println(tate[i]);
		}
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in).useDelimiter("\\D");
		int ax, by, i;
		int w = sc.nextInt();
		int n = sc.nextInt();
		int[] tate = new int[w];
		for (i = 0; i < w; i++) {
			tate[i] = i + 1;
		}
		for (i = 0; i < n; i++) {
			ax = sc.nextInt();
			by = sc.nextInt();
			int sub = tate[ax - 1];
			tate[ax - 1] = tate[by - 1];
			tate[by - 1] = sub;
		}
		for (i = 0; i < w; i++) {
			System.out.println(tate[i]);
		}
	}
}