import java.util.*;class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);List<Integer>l=new ArrayList<Integer>();int t=s.nextInt(),i=0;for(;i++<t;)l.add(i);for(t=s.nextInt(),s.nextLine();t-->0;){String[]e=s.nextLine().split(",");Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1);}for(int e:l)System.out.println(e);}} import java.util.*; util.* java class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);List<Integer>l=new ArrayList<Integer>();int t=s.nextInt(),i=0;for(;i++<t;)l.add(i);for(t=s.nextInt(),s.nextLine();t-->0;){String[]e=s.nextLine().split(",");Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1);}for(int e:l)System.out.println(e);}} Main public static void main(String[] a){Scanner s=new Scanner(System.in);List<Integer>l=new ArrayList<Integer>();int t=s.nextInt(),i=0;for(;i++<t;)l.add(i);for(t=s.nextInt(),s.nextLine();t-->0;){String[]e=s.nextLine().split(",");Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1);}for(int e:l)System.out.println(e);} main {Scanner s=new Scanner(System.in);List<Integer>l=new ArrayList<Integer>();int t=s.nextInt(),i=0;for(;i++<t;)l.add(i);for(t=s.nextInt(),s.nextLine();t-->0;){String[]e=s.nextLine().split(",");Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1);}for(int e:l)System.out.println(e);} Scanner s=new Scanner(System.in); s new Scanner(System.in) List<Integer>l=new ArrayList<Integer>(); l new ArrayList<Integer>() int t=s.nextInt() t s.nextInt() s.nextInt s i=0; i 0 for(;i++<t;)l.add(i); ; i++<t i++ i t l.add(i); l.add(i) l.add l i for(t=s.nextInt(),s.nextLine();t-->0;){String[]e=s.nextLine().split(",");Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1);} t=s.nextInt(),s.nextLine(); t=s.nextInt() t s.nextInt() s.nextInt s s.nextLine() s.nextLine s t-->0 t-- t 0 {String[]e=s.nextLine().split(",");Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1);} {String[]e=s.nextLine().split(",");Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1);} String[]e=s.nextLine().split(","); e s.nextLine().split(",") s.nextLine().split s.nextLine() s.nextLine s "," Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1) Collections.swap Collections l new Integer(e[0])-1 new Integer(e[0]) 1 new Integer(e[1])-1 new Integer(e[1]) 1 for(int e:l)System.out.println(e); int e l System.out.println(e); System.out.println(e) System.out.println System.out System System.out e String[] a a
import java.util.*;class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);List<Integer>l=new ArrayList<Integer>();int t=s.nextInt(),i=0;for(;i++<t;)l.add(i);for(t=s.nextInt(),s.nextLine();t-->0;){String[]e=s.nextLine().split(",");Collections.swap(l, new Integer(e[0])-1, new Integer(e[1])-1);}for(int e:l)System.out.println(e);}}