import java.util.ArrayList;
import java.util.Scanner;


public class Main {
	private	static	Scanner				stdin = null;
	private	static	ArrayList<Integer>	list  = null;

	static {
		list  = new ArrayList<Integer>();
		stdin = new Scanner(System.in);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int		nLine  = stdin.nextInt();
		int		nCross = stdin.nextInt();
		int[]	aCross = null;
		int[]	aIndex = new int[2];

		for(int i = 1; i <= nLine; i++) {
			list.add(i);
		}

		for(int nLoop = 1; nLoop <= nCross; nLoop++) {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		}

		for(int i = 1; i <= nLine; i++) {
			System.out.println(list.indexOf(i) + 1);
		}
	}

	private static int[] parseCross() {
		int[]		aCross = new int[2];
		String[]	aNum   = stdin.next().split(",");

		aCross[0] = Integer.parseInt(aNum[0]);
		aCross[1] = Integer.parseInt(aNum[1]);

		return aCross;
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	private	static	Scanner				stdin = null;
	private	static	ArrayList<Integer>	list  = null;

	static {
		list  = new ArrayList<Integer>();
		stdin = new Scanner(System.in);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int		nLine  = stdin.nextInt();
		int		nCross = stdin.nextInt();
		int[]	aCross = null;
		int[]	aIndex = new int[2];

		for(int i = 1; i <= nLine; i++) {
			list.add(i);
		}

		for(int nLoop = 1; nLoop <= nCross; nLoop++) {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		}

		for(int i = 1; i <= nLine; i++) {
			System.out.println(list.indexOf(i) + 1);
		}
	}

	private static int[] parseCross() {
		int[]		aCross = new int[2];
		String[]	aNum   = stdin.next().split(",");

		aCross[0] = Integer.parseInt(aNum[0]);
		aCross[1] = Integer.parseInt(aNum[1]);

		return aCross;
	}
} Main private	static	Scanner				stdin = null; stdin null private	static	ArrayList<Integer>	list  = null; list null /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int		nLine  = stdin.nextInt();
		int		nCross = stdin.nextInt();
		int[]	aCross = null;
		int[]	aIndex = new int[2];

		for(int i = 1; i <= nLine; i++) {
			list.add(i);
		}

		for(int nLoop = 1; nLoop <= nCross; nLoop++) {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		}

		for(int i = 1; i <= nLine; i++) {
			System.out.println(list.indexOf(i) + 1);
		}
	} main {
		// TODO Auto-generated method stub
		int		nLine  = stdin.nextInt();
		int		nCross = stdin.nextInt();
		int[]	aCross = null;
		int[]	aIndex = new int[2];

		for(int i = 1; i <= nLine; i++) {
			list.add(i);
		}

		for(int nLoop = 1; nLoop <= nCross; nLoop++) {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		}

		for(int i = 1; i <= nLine; i++) {
			System.out.println(list.indexOf(i) + 1);
		}
	} int		nLine  = stdin.nextInt(); nLine stdin.nextInt() stdin.nextInt stdin int		nCross = stdin.nextInt(); nCross stdin.nextInt() stdin.nextInt stdin int[]	aCross = null; aCross null int[]	aIndex = new int[2]; aIndex new int[2] 2 for(int i = 1; i <= nLine; i++) {
			list.add(i);
		} int i = 1; int i = 1; i 1 i <= nLine i nLine i++ i++ i {
			list.add(i);
		} {
			list.add(i);
		} list.add(i) list.add list i for(int nLoop = 1; nLoop <= nCross; nLoop++) {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		} int nLoop = 1; int nLoop = 1; nLoop 1 nLoop <= nCross nLoop nCross nLoop++ nLoop++ nLoop {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		} {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		} aCross    = parseCross() aCross parseCross() parseCross aIndex[0] = list.indexOf(aCross[0]) aIndex[0] aIndex 0 list.indexOf(aCross[0]) list.indexOf list aCross[0] aCross 0 aIndex[1] = list.indexOf(aCross[1]) aIndex[1] aIndex 1 list.indexOf(aCross[1]) list.indexOf list aCross[1] aCross 1 list.set(aIndex[1], aCross[0]) list.set list aIndex[1] aIndex 1 aCross[0] aCross 0 list.set(aIndex[0], aCross[1]) list.set list aIndex[0] aIndex 0 aCross[1] aCross 1 for(int i = 1; i <= nLine; i++) {
			System.out.println(list.indexOf(i) + 1);
		} int i = 1; int i = 1; i 1 i <= nLine i nLine i++ i++ i {
			System.out.println(list.indexOf(i) + 1);
		} {
			System.out.println(list.indexOf(i) + 1);
		} System.out.println(list.indexOf(i) + 1) System.out.println System.out System System.out list.indexOf(i) + 1 list.indexOf(i) list.indexOf list i 1 String[] args args private static int[] parseCross() {
		int[]		aCross = new int[2];
		String[]	aNum   = stdin.next().split(",");

		aCross[0] = Integer.parseInt(aNum[0]);
		aCross[1] = Integer.parseInt(aNum[1]);

		return aCross;
	} parseCross {
		int[]		aCross = new int[2];
		String[]	aNum   = stdin.next().split(",");

		aCross[0] = Integer.parseInt(aNum[0]);
		aCross[1] = Integer.parseInt(aNum[1]);

		return aCross;
	} int[]		aCross = new int[2]; aCross new int[2] 2 String[]	aNum   = stdin.next().split(","); aNum stdin.next().split(",") stdin.next().split stdin.next() stdin.next stdin "," aCross[0] = Integer.parseInt(aNum[0]) aCross[0] aCross 0 Integer.parseInt(aNum[0]) Integer.parseInt Integer aNum[0] aNum 0 aCross[1] = Integer.parseInt(aNum[1]) aCross[1] aCross 1 Integer.parseInt(aNum[1]) Integer.parseInt Integer aNum[1] aNum 1 return aCross; aCross public class Main {
	private	static	Scanner				stdin = null;
	private	static	ArrayList<Integer>	list  = null;

	static {
		list  = new ArrayList<Integer>();
		stdin = new Scanner(System.in);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int		nLine  = stdin.nextInt();
		int		nCross = stdin.nextInt();
		int[]	aCross = null;
		int[]	aIndex = new int[2];

		for(int i = 1; i <= nLine; i++) {
			list.add(i);
		}

		for(int nLoop = 1; nLoop <= nCross; nLoop++) {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		}

		for(int i = 1; i <= nLine; i++) {
			System.out.println(list.indexOf(i) + 1);
		}
	}

	private static int[] parseCross() {
		int[]		aCross = new int[2];
		String[]	aNum   = stdin.next().split(",");

		aCross[0] = Integer.parseInt(aNum[0]);
		aCross[1] = Integer.parseInt(aNum[1]);

		return aCross;
	}
} public class Main {
	private	static	Scanner				stdin = null;
	private	static	ArrayList<Integer>	list  = null;

	static {
		list  = new ArrayList<Integer>();
		stdin = new Scanner(System.in);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int		nLine  = stdin.nextInt();
		int		nCross = stdin.nextInt();
		int[]	aCross = null;
		int[]	aIndex = new int[2];

		for(int i = 1; i <= nLine; i++) {
			list.add(i);
		}

		for(int nLoop = 1; nLoop <= nCross; nLoop++) {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		}

		for(int i = 1; i <= nLine; i++) {
			System.out.println(list.indexOf(i) + 1);
		}
	}

	private static int[] parseCross() {
		int[]		aCross = new int[2];
		String[]	aNum   = stdin.next().split(",");

		aCross[0] = Integer.parseInt(aNum[0]);
		aCross[1] = Integer.parseInt(aNum[1]);

		return aCross;
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;


public class Main {
	private	static	Scanner				stdin = null;
	private	static	ArrayList<Integer>	list  = null;

	static {
		list  = new ArrayList<Integer>();
		stdin = new Scanner(System.in);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int		nLine  = stdin.nextInt();
		int		nCross = stdin.nextInt();
		int[]	aCross = null;
		int[]	aIndex = new int[2];

		for(int i = 1; i <= nLine; i++) {
			list.add(i);
		}

		for(int nLoop = 1; nLoop <= nCross; nLoop++) {
			aCross    = parseCross();
			aIndex[0] = list.indexOf(aCross[0]);
			aIndex[1] = list.indexOf(aCross[1]);
			list.set(aIndex[1], aCross[0]);
			list.set(aIndex[0], aCross[1]);
		}

		for(int i = 1; i <= nLine; i++) {
			System.out.println(list.indexOf(i) + 1);
		}
	}

	private static int[] parseCross() {
		int[]		aCross = new int[2];
		String[]	aNum   = stdin.next().split(",");

		aCross[0] = Integer.parseInt(aNum[0]);
		aCross[1] = Integer.parseInt(aNum[1]);

		return aCross;
	}
}