import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int len = scan.nextInt();
int n = scan.nextInt();
int[] arr = new int[len];
for(int i = 0; i < len; i++){
arr[i] = i+1;
}
for(int i = 0; i < n; i++){
int flag = scan.nextInt();
int index = scan.nextInt();
if(flag == 0){
Arrays.sort(arr, 0, index);
for(int left = 0, right = index-1; left < right; left++, right--){
int temp = arr[left];
arr[left] = arr[right];
arr[right] = temp;
}
}else if(flag == 1){
Arrays.sort(arr, index-1, len);
}
}
for(int i = 0; i < len; i++){
System.out.print(arr[i] + " ");
}
}
}