import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int N = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());
int[] arr = new int[N];
int tmp;
for(int i=0; i<arr.length; i++){
arr[i] =i+1;
}
for(int j=0; j<M; j++){
st = new StringTokenizer(br.readLine());
// 각 줄마다 입력받은 I,J는 바로 배열에 쓰기 위하여 1씩 빼준다
int I = Integer.parseInt(st.nextToken())-1;
int J = Integer.parseInt(st.nextToken())-1;
for(int k=I; k<=J; k++, J--) {
tmp = arr[k];
arr[k] = arr[J];
arr[J] = tmp;
}
}
for(int z=0; z<arr.length; z++){
System.out.print(arr[z]+" ");
}
br.close();
}
}