import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;

public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int v = Integer.valueOf(br.readLine());
		ArrayList<Integer> amida = new ArrayList<Integer>(v);
		for(int i=0; i<v; i++)
			amida.add(i+1);

		int h = Integer.valueOf(br.readLine());
		
		for(int i=0; i<h; i++){
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		}

		for(int i=0; i<v; i++)
			System.out.println(amida.get(i));
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int v = Integer.valueOf(br.readLine());
		ArrayList<Integer> amida = new ArrayList<Integer>(v);
		for(int i=0; i<v; i++)
			amida.add(i+1);

		int h = Integer.valueOf(br.readLine());
		
		for(int i=0; i<h; i++){
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		}

		for(int i=0; i<v; i++)
			System.out.println(amida.get(i));
	}
} Main public static void main(String[] arg) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int v = Integer.valueOf(br.readLine());
		ArrayList<Integer> amida = new ArrayList<Integer>(v);
		for(int i=0; i<v; i++)
			amida.add(i+1);

		int h = Integer.valueOf(br.readLine());
		
		for(int i=0; i<h; i++){
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		}

		for(int i=0; i<v; i++)
			System.out.println(amida.get(i));
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int v = Integer.valueOf(br.readLine());
		ArrayList<Integer> amida = new ArrayList<Integer>(v);
		for(int i=0; i<v; i++)
			amida.add(i+1);

		int h = Integer.valueOf(br.readLine());
		
		for(int i=0; i<h; i++){
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		}

		for(int i=0; i<v; i++)
			System.out.println(amida.get(i));
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int v = Integer.valueOf(br.readLine()); v Integer.valueOf(br.readLine()) Integer.valueOf Integer br.readLine() br.readLine br ArrayList<Integer> amida = new ArrayList<Integer>(v); amida new ArrayList<Integer>(v) for(int i=0; i<v; i++)
			amida.add(i+1); int i=0; int i=0; i 0 i<v i v i++ i++ i amida.add(i+1); amida.add(i+1) amida.add amida i+1 i 1 int h = Integer.valueOf(br.readLine()); h Integer.valueOf(br.readLine()) Integer.valueOf Integer br.readLine() br.readLine br for(int i=0; i<h; i++){
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		} int i=0; int i=0; i 0 i<h i h i++ i++ i {
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		} {
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		} String swapInd = br.readLine(); swapInd br.readLine() br.readLine br int swap1 = Integer.valueOf(swapInd.split(",")[0]); swap1 Integer.valueOf(swapInd.split(",")[0]) Integer.valueOf Integer swapInd.split(",")[0] swapInd.split(",") swapInd.split swapInd "," 0 int swap2 = Integer.valueOf(swapInd.split(",")[1]); swap2 Integer.valueOf(swapInd.split(",")[1]) Integer.valueOf Integer swapInd.split(",")[1] swapInd.split(",") swapInd.split swapInd "," 1 Collections.swap(amida,swap1-1,swap2-1) Collections.swap Collections amida swap1-1 swap1 1 swap2-1 swap2 1 for(int i=0; i<v; i++)
			System.out.println(amida.get(i)); int i=0; int i=0; i 0 i<v i v i++ i++ i System.out.println(amida.get(i)); System.out.println(amida.get(i)) System.out.println System.out System System.out amida.get(i) amida.get amida i String[] arg arg public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int v = Integer.valueOf(br.readLine());
		ArrayList<Integer> amida = new ArrayList<Integer>(v);
		for(int i=0; i<v; i++)
			amida.add(i+1);

		int h = Integer.valueOf(br.readLine());
		
		for(int i=0; i<h; i++){
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		}

		for(int i=0; i<v; i++)
			System.out.println(amida.get(i));
	}
} public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int v = Integer.valueOf(br.readLine());
		ArrayList<Integer> amida = new ArrayList<Integer>(v);
		for(int i=0; i<v; i++)
			amida.add(i+1);

		int h = Integer.valueOf(br.readLine());
		
		for(int i=0; i<h; i++){
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		}

		for(int i=0; i<v; i++)
			System.out.println(amida.get(i));
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;

public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int v = Integer.valueOf(br.readLine());
		ArrayList<Integer> amida = new ArrayList<Integer>(v);
		for(int i=0; i<v; i++)
			amida.add(i+1);

		int h = Integer.valueOf(br.readLine());
		
		for(int i=0; i<h; i++){
			String swapInd = br.readLine();
			int swap1 = Integer.valueOf(swapInd.split(",")[0]);
			int swap2 = Integer.valueOf(swapInd.split(",")[1]);
			Collections.swap(amida,swap1-1,swap2-1);
		}

		for(int i=0; i<v; i++)
			System.out.println(amida.get(i));
	}
}