import java.util.Scanner;

public class Main
{
	private static void swap(int r[],int a,int b)
	{
		int tmp=r[a];
		r[a]=r[b];
		r[b]=tmp;
	}
	public static void main(String[] args)
	{
		Scanner scan=new Scanner(System.in);
		int w=scan.nextInt();
		int n=scan.nextInt();
		int a,b;
		int[] r=new int[w];
		for(int i=0;i<r.length;i++){
			r[i]=i+1;
		}
		for(int i=0;i<n;i++){
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		}
		for(int i=0;i<r.length;i++){
			System.out.println(r[i]);
		}
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main
{
	private static void swap(int r[],int a,int b)
	{
		int tmp=r[a];
		r[a]=r[b];
		r[b]=tmp;
	}
	public static void main(String[] args)
	{
		Scanner scan=new Scanner(System.in);
		int w=scan.nextInt();
		int n=scan.nextInt();
		int a,b;
		int[] r=new int[w];
		for(int i=0;i<r.length;i++){
			r[i]=i+1;
		}
		for(int i=0;i<n;i++){
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		}
		for(int i=0;i<r.length;i++){
			System.out.println(r[i]);
		}
		scan.close();
	}
} Main private static void swap(int r[],int a,int b)
	{
		int tmp=r[a];
		r[a]=r[b];
		r[b]=tmp;
	} swap {
		int tmp=r[a];
		r[a]=r[b];
		r[b]=tmp;
	} int tmp=r[a]; tmp r[a] r a r[a]=r[b] r[a] r a r[b] r b r[b]=tmp r[b] r b tmp int r[] r int a a int b b public static void main(String[] args)
	{
		Scanner scan=new Scanner(System.in);
		int w=scan.nextInt();
		int n=scan.nextInt();
		int a,b;
		int[] r=new int[w];
		for(int i=0;i<r.length;i++){
			r[i]=i+1;
		}
		for(int i=0;i<n;i++){
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		}
		for(int i=0;i<r.length;i++){
			System.out.println(r[i]);
		}
		scan.close();
	} main {
		Scanner scan=new Scanner(System.in);
		int w=scan.nextInt();
		int n=scan.nextInt();
		int a,b;
		int[] r=new int[w];
		for(int i=0;i<r.length;i++){
			r[i]=i+1;
		}
		for(int i=0;i<n;i++){
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		}
		for(int i=0;i<r.length;i++){
			System.out.println(r[i]);
		}
		scan.close();
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int w=scan.nextInt(); w scan.nextInt() scan.nextInt scan int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan int a a b; b int[] r=new int[w]; r new int[w] w for(int i=0;i<r.length;i++){
			r[i]=i+1;
		} int i=0; int i=0; i 0 i<r.length i r.length r r.length i++ i++ i {
			r[i]=i+1;
		} {
			r[i]=i+1;
		} r[i]=i+1 r[i] r i i+1 i 1 for(int i=0;i<n;i++){
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		} {
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		} String[] tmp=scan.next().split(","); tmp scan.next().split(",") scan.next().split scan.next() scan.next scan "," a=Integer.parseInt(tmp[0]) a Integer.parseInt(tmp[0]) Integer.parseInt Integer tmp[0] tmp 0 b=Integer.parseInt(tmp[1]) b Integer.parseInt(tmp[1]) Integer.parseInt Integer tmp[1] tmp 1 swap(r,a-1,b-1) swap r a-1 a 1 b-1 b 1 for(int i=0;i<r.length;i++){
			System.out.println(r[i]);
		} int i=0; int i=0; i 0 i<r.length i r.length r r.length i++ i++ i {
			System.out.println(r[i]);
		} {
			System.out.println(r[i]);
		} System.out.println(r[i]) System.out.println System.out System System.out r[i] r i scan.close() scan.close scan String[] args args public class Main
{
	private static void swap(int r[],int a,int b)
	{
		int tmp=r[a];
		r[a]=r[b];
		r[b]=tmp;
	}
	public static void main(String[] args)
	{
		Scanner scan=new Scanner(System.in);
		int w=scan.nextInt();
		int n=scan.nextInt();
		int a,b;
		int[] r=new int[w];
		for(int i=0;i<r.length;i++){
			r[i]=i+1;
		}
		for(int i=0;i<n;i++){
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		}
		for(int i=0;i<r.length;i++){
			System.out.println(r[i]);
		}
		scan.close();
	}
} public class Main
{
	private static void swap(int r[],int a,int b)
	{
		int tmp=r[a];
		r[a]=r[b];
		r[b]=tmp;
	}
	public static void main(String[] args)
	{
		Scanner scan=new Scanner(System.in);
		int w=scan.nextInt();
		int n=scan.nextInt();
		int a,b;
		int[] r=new int[w];
		for(int i=0;i<r.length;i++){
			r[i]=i+1;
		}
		for(int i=0;i<n;i++){
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		}
		for(int i=0;i<r.length;i++){
			System.out.println(r[i]);
		}
		scan.close();
	}
} Main
import java.util.Scanner;

public class Main
{
	private static void swap(int r[],int a,int b)
	{
		int tmp=r[a];
		r[a]=r[b];
		r[b]=tmp;
	}
	public static void main(String[] args)
	{
		Scanner scan=new Scanner(System.in);
		int w=scan.nextInt();
		int n=scan.nextInt();
		int a,b;
		int[] r=new int[w];
		for(int i=0;i<r.length;i++){
			r[i]=i+1;
		}
		for(int i=0;i<n;i++){
			String[] tmp=scan.next().split(",");
			a=Integer.parseInt(tmp[0]);
			b=Integer.parseInt(tmp[1]);
			swap(r,a-1,b-1);
		}
		for(int i=0;i<r.length;i++){
			System.out.println(r[i]);
		}
		scan.close();
	}
}