import java.util.*;

public class Main {
	
	private static int[] list;
	
	public static void main(String[] args) {

		//input
		Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
		int w = sc.nextInt();
		int n = sc.nextInt();
		w++;

		//initialization
		list = new int[w];
		for(int i=1;i<w;i++){list[i]=i;}
		
		//calculation
		String[] s;
		for(int i=0;i<n;i++){
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		}

	    //output
		for(int i=1;i<w;i++){System.out.println(list[i]);}
	}
	
	private static void swap(int a,int b){
		list[b] = list[a] - list[b];
		list[a] -= list[b];
		list[b] += list[a];
	}
} import java.util.*; util.* java public class Main {
	
	private static int[] list;
	
	public static void main(String[] args) {

		//input
		Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
		int w = sc.nextInt();
		int n = sc.nextInt();
		w++;

		//initialization
		list = new int[w];
		for(int i=1;i<w;i++){list[i]=i;}
		
		//calculation
		String[] s;
		for(int i=0;i<n;i++){
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		}

	    //output
		for(int i=1;i<w;i++){System.out.println(list[i]);}
	}
	
	private static void swap(int a,int b){
		list[b] = list[a] - list[b];
		list[a] -= list[b];
		list[b] += list[a];
	}
} Main private static int[] list; list public static void main(String[] args) {

		//input
		Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
		int w = sc.nextInt();
		int n = sc.nextInt();
		w++;

		//initialization
		list = new int[w];
		for(int i=1;i<w;i++){list[i]=i;}
		
		//calculation
		String[] s;
		for(int i=0;i<n;i++){
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		}

	    //output
		for(int i=1;i<w;i++){System.out.println(list[i]);}
	} main {

		//input
		Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
		int w = sc.nextInt();
		int n = sc.nextInt();
		w++;

		//initialization
		list = new int[w];
		for(int i=1;i<w;i++){list[i]=i;}
		
		//calculation
		String[] s;
		for(int i=0;i<n;i++){
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		}

	    //output
		for(int i=1;i<w;i++){System.out.println(list[i]);}
	} Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator")); sc new Scanner(System.in).useDelimiter(System.getProperty("line.separator")) new Scanner(System.in).useDelimiter new Scanner(System.in) System.getProperty("line.separator") System.getProperty System "line.separator" int w = sc.nextInt(); w sc.nextInt() sc.nextInt sc int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc w++ w list = new int[w] list new int[w] w for(int i=1;i<w;i++){list[i]=i;} int i=1; int i=1; i 1 i<w i w i++ i++ i {list[i]=i;} {list[i]=i;} list[i]=i list[i] list i i String[] s; s for(int i=0;i<n;i++){
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		} {
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		} s = sc.next().split(",") s sc.next().split(",") sc.next().split sc.next() sc.next sc "," swap(Integer.parseInt(s[0]),Integer.parseInt(s[1])) swap Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 for(int i=1;i<w;i++){System.out.println(list[i]);} int i=1; int i=1; i 1 i<w i w i++ i++ i {System.out.println(list[i]);} {System.out.println(list[i]);} System.out.println(list[i]) System.out.println System.out System System.out list[i] list i String[] args args private static void swap(int a,int b){
		list[b] = list[a] - list[b];
		list[a] -= list[b];
		list[b] += list[a];
	} swap {
		list[b] = list[a] - list[b];
		list[a] -= list[b];
		list[b] += list[a];
	} list[b] = list[a] - list[b] list[b] list b list[a] - list[b] list[a] list a list[b] list b list[a] -= list[b] list[a] list a list[b] list b list[b] += list[a] list[b] list b list[a] list a int a a int b b public class Main {
	
	private static int[] list;
	
	public static void main(String[] args) {

		//input
		Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
		int w = sc.nextInt();
		int n = sc.nextInt();
		w++;

		//initialization
		list = new int[w];
		for(int i=1;i<w;i++){list[i]=i;}
		
		//calculation
		String[] s;
		for(int i=0;i<n;i++){
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		}

	    //output
		for(int i=1;i<w;i++){System.out.println(list[i]);}
	}
	
	private static void swap(int a,int b){
		list[b] = list[a] - list[b];
		list[a] -= list[b];
		list[b] += list[a];
	}
} public class Main {
	
	private static int[] list;
	
	public static void main(String[] args) {

		//input
		Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
		int w = sc.nextInt();
		int n = sc.nextInt();
		w++;

		//initialization
		list = new int[w];
		for(int i=1;i<w;i++){list[i]=i;}
		
		//calculation
		String[] s;
		for(int i=0;i<n;i++){
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		}

	    //output
		for(int i=1;i<w;i++){System.out.println(list[i]);}
	}
	
	private static void swap(int a,int b){
		list[b] = list[a] - list[b];
		list[a] -= list[b];
		list[b] += list[a];
	}
} Main
import java.util.*;

public class Main {
	
	private static int[] list;
	
	public static void main(String[] args) {

		//input
		Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
		int w = sc.nextInt();
		int n = sc.nextInt();
		w++;

		//initialization
		list = new int[w];
		for(int i=1;i<w;i++){list[i]=i;}
		
		//calculation
		String[] s;
		for(int i=0;i<n;i++){
			s = sc.next().split(",");
			swap(Integer.parseInt(s[0]),Integer.parseInt(s[1]));
		}

	    //output
		for(int i=1;i<w;i++){System.out.println(list[i]);}
	}
	
	private static void swap(int a,int b){
		list[b] = list[a] - list[b];
		list[a] -= list[b];
		list[b] += list[a];
	}
}