import java.util.Arrays;
import java.util.Scanner;
public class Main {
static int[] arr;
static int[][] ope;
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int size = scanner.nextInt();
int turns = scanner.nextInt();
arr = new int[size + 1];
ope = new int[turns][2];
for (int i = 1; i < size + 1; i++) {
arr[i] = i;
}
for (int i = 0; i < turns; i++) {
ope[i][0]=scanner.nextInt();
ope[i][1]=scanner.nextInt();
}
sort();
for (int i = 1; i < size + 1; i++) {
System.out.print(arr[i] + " ");
}
}
public static void sort(){
for (int i = 0; i < ope.length; i++) {
if (ope[i][0]==1){
Arrays.sort(arr,ope[i][1],arr.length);
}
else {
Arrays.sort(arr,1,ope[i][1]+1);
for (int j = 1; j <ope[i][1]/2+1 ; j++) {
int temp=arr[j];
arr[j]=arr[ope[i][1]+1-j];
arr[ope[i][1]+1-j]=temp;
}
}
}
}
}
10-15
537
04-17
258
06-01
592