// Arup Guha
// 3/5/2020
// Solution to 2020 February USACO Silver Problem: Swappity Swap

import java.util.*;
import java.io.*;

public class swap_silver {

	public static void main(String[] args) throws Exception {
		
		// Set up file.
		Scanner stdin = new Scanner(new File("swap.in"));
		
		// Set up permutation array.
		int n = stdin.nextInt();
		int cycle = stdin.nextInt();
		int reps = stdin.nextInt();
		int[] perm = new int[n];
		for (int i=0; i<n; i++) perm[i] = i;
		
		// Now do the swaps for one iteration.
		for (int i=0; i<cycle; i++) {
			int s = stdin.nextInt()-1;
			int e = stdin.nextInt()-1;
			reverse(perm, s, e);
		}	
		
		// Do it...
		int[] res = go(perm, reps);
		StringBuffer output = new StringBuffer();
		for (int i=0; i<n; i++)
			output.append((res[i]+1)+"\n");

		// Output to file.
		PrintWriter out = new PrintWriter(new FileWriter("swap.out"));
		out.print(output);
		out.close();		
		stdin.close();
	}
	
	// Compose perm with itself k times.
	public static int[] go(int[] perm, int k) {
		
		// Base case.
		if (k == 1) return perm;
		
		// Speed up, go halfway and compose with itself.
		if (k%2 == 0) {
			int[] tmp = go(perm, k/2);
			return compose(tmp, tmp);
		}
		
		// Usual breakdown.
		int[] tmp = go(perm, k-1);
		return compose(tmp, perm);
	}
	
	// Compose b with a, so apply a, then b.
	public static int[] compose(int[] a, int[] b) {
		int n = a.length;
		int[] res = new int[n];
		for (int i=0; i<n; i++)
			res[i] = b[a[i]];
		return res;
	}
	
	// Reverses arr[s..e].
	public static void reverse(int[] arr, int s, int e) {
		
		// Swap corresponding pairs from ends to middle.
		while (s < e) {
			int tmp = arr[s];
			arr[s] = arr[e];
			arr[e] = tmp;
			s++;
			e--;
		}
	}
}