import java.util.*;
public class Main {
    public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
        int w=scan.nextInt();
        int [] line =new int[w+1];
        for(int i=1;i<w+1;i++)
        	line[i]=i;
        int n=scan.nextInt();
        scan.useDelimiter(",|\\n");
        while(n!=0){
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        }
        for(int i =1;i<w+1;i++)
        System.out.println(line[i]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
        int w=scan.nextInt();
        int [] line =new int[w+1];
        for(int i=1;i<w+1;i++)
        	line[i]=i;
        int n=scan.nextInt();
        scan.useDelimiter(",|\\n");
        while(n!=0){
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        }
        for(int i =1;i<w+1;i++)
        System.out.println(line[i]);
    }
} Main public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
        int w=scan.nextInt();
        int [] line =new int[w+1];
        for(int i=1;i<w+1;i++)
        	line[i]=i;
        int n=scan.nextInt();
        scan.useDelimiter(",|\\n");
        while(n!=0){
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        }
        for(int i =1;i<w+1;i++)
        System.out.println(line[i]);
    } main {
        Scanner scan = new Scanner(System.in);
        int w=scan.nextInt();
        int [] line =new int[w+1];
        for(int i=1;i<w+1;i++)
        	line[i]=i;
        int n=scan.nextInt();
        scan.useDelimiter(",|\\n");
        while(n!=0){
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        }
        for(int i =1;i<w+1;i++)
        System.out.println(line[i]);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int w=scan.nextInt(); w scan.nextInt() scan.nextInt scan int [] line =new int[w+1]; line new int[w+1] w+1 w 1 for(int i=1;i<w+1;i++)
        	line[i]=i; int i=1; int i=1; i 1 i<w+1 i w+1 w 1 i++ i++ i line[i]=i; line[i]=i line[i] line i i int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan scan.useDelimiter(",|\\n") scan.useDelimiter scan ",|\\n" while(n!=0){
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        } n!=0 n 0 {
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        } int a=scan.nextInt(); a scan.nextInt() scan.nextInt scan int b=scan.nextInt(); b scan.nextInt() scan.nextInt scan line[a]=line[a]^line[b] line[a] line a line[a]^line[b] line[a] line a line[b] line b line[b]=line[a]^line[b] line[b] line b line[a]^line[b] line[a] line a line[b] line b line[a]=line[a]^line[b] line[a] line a line[a]^line[b] line[a] line a line[b] line b n-- n for(int i =1;i<w+1;i++)
        System.out.println(line[i]); int i =1; int i =1; i 1 i<w+1 i w+1 w 1 i++ i++ i System.out.println(line[i]); System.out.println(line[i]) System.out.println System.out System System.out line[i] line i String[] args args public class Main {
    public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
        int w=scan.nextInt();
        int [] line =new int[w+1];
        for(int i=1;i<w+1;i++)
        	line[i]=i;
        int n=scan.nextInt();
        scan.useDelimiter(",|\\n");
        while(n!=0){
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        }
        for(int i =1;i<w+1;i++)
        System.out.println(line[i]);
    }
} public class Main {
    public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
        int w=scan.nextInt();
        int [] line =new int[w+1];
        for(int i=1;i<w+1;i++)
        	line[i]=i;
        int n=scan.nextInt();
        scan.useDelimiter(",|\\n");
        while(n!=0){
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        }
        for(int i =1;i<w+1;i++)
        System.out.println(line[i]);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
        int w=scan.nextInt();
        int [] line =new int[w+1];
        for(int i=1;i<w+1;i++)
        	line[i]=i;
        int n=scan.nextInt();
        scan.useDelimiter(",|\\n");
        while(n!=0){
        	
        	int a=scan.nextInt();
        	int b=scan.nextInt();
        	line[a]=line[a]^line[b];
        	line[b]=line[a]^line[b];
        	line[a]=line[a]^line[b];
        n--;	
        }
        for(int i =1;i<w+1;i++)
        System.out.println(line[i]);
    }
}