import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    private static final String REGIX_COMMA = ",";

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int wide = 0;
        int num = 0;

        try {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    private static final String REGIX_COMMA = ",";

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int wide = 0;
        int num = 0;

        try {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
} Main private static final String REGIX_COMMA = ","; REGIX_COMMA "," public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int wide = 0;
        int num = 0;

        try {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    } main {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int wide = 0;
        int num = 0;

        try {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int wide = 0; wide 0 int num = 0; num 0 try {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } IOException e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                in.close();
            } in.close() in.close in {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } wide = Integer.valueOf(in.readLine()) wide Integer.valueOf(in.readLine()) Integer.valueOf Integer in.readLine() in.readLine in num = Integer.valueOf(in.readLine()) num Integer.valueOf(in.readLine()) Integer.valueOf Integer in.readLine() in.readLine in int[] lot = new int[wide]; lot new int[wide] wide for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            } int i = 0; int i = 0; i 0 i < lot.length i lot.length lot lot.length i++ i++ i {
                lot[i] = i + 1;
            } {
                lot[i] = i + 1;
            } lot[i] = i + 1 lot[i] lot i i + 1 i 1 for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            } int j = 0; int j = 0; j 0 j < num j num j++ j++ j {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            } {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            } String[] changePosition = in.readLine().split(REGIX_COMMA); changePosition in.readLine().split(REGIX_COMMA) in.readLine().split in.readLine() in.readLine in REGIX_COMMA int left = Integer.valueOf(changePosition[0]) - 1; left Integer.valueOf(changePosition[0]) - 1 Integer.valueOf(changePosition[0]) Integer.valueOf Integer changePosition[0] changePosition 0 1 int right = Integer.valueOf(changePosition[1]) - 1; right Integer.valueOf(changePosition[1]) - 1 Integer.valueOf(changePosition[1]) Integer.valueOf Integer changePosition[1] changePosition 1 1 int temp = lot[left]; temp lot[left] lot left lot[left] = lot[right] lot[left] lot left lot[right] lot right lot[right] = temp lot[right] lot right temp for (int answer : lot) {
                System.out.println(answer);
            } int answer lot {
                System.out.println(answer);
            } {
                System.out.println(answer);
            } System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

    private static final String REGIX_COMMA = ",";

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int wide = 0;
        int num = 0;

        try {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
} public class Main {

    private static final String REGIX_COMMA = ",";

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int wide = 0;
        int num = 0;

        try {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    private static final String REGIX_COMMA = ",";

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int wide = 0;
        int num = 0;

        try {
            wide = Integer.valueOf(in.readLine());
            num = Integer.valueOf(in.readLine());

            int[] lot = new int[wide];

            for (int i = 0; i < lot.length; i++) {
                lot[i] = i + 1;
            }

            for (int j = 0; j < num; j++) {

                String[] changePosition = in.readLine().split(REGIX_COMMA);
                int left = Integer.valueOf(changePosition[0]) - 1;
                int right = Integer.valueOf(changePosition[1]) - 1;

                int temp = lot[left];
                lot[left] = lot[right];
                lot[right] = temp;
            }

            for (int answer : lot) {
                System.out.println(answer);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}