import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] STR = br.readLine().split(" ");
int N = Integer.parseInt( STR[0] );//5
int M = Integer.parseInt( STR[1] );//4
int[] intArr = new int[N];
for(int i = 0 ; i < N ; i++){
intArr[i] = i+1;//[1,2,3,4,5]
}
for(int j = 0 ; j < M ; j++){
int[] temp = intArr.clone(); //clone 중요!!
String[] STR2 = br.readLine().split(" ");
int a = Integer.parseInt( STR2[0] );
int b = Integer.parseInt( STR2[1] );
int c = a; //a나 b를 아래 반복문에서 바로 사용하면 ++or--때문에 불가
for(int k = b ; k>=a ;k-- ){
intArr[k-1] = temp[c-1];
c++;
}
}
for(int m = 0 ; m < intArr.length ; m++){
bw.write(String.valueOf( intArr[m]) + " " );
}
bw.flush();
bw.close();
}
}