n,m=map(int,input().split())
num=[int(i) for i in range(1,n+1)]
op=[]
for i in range(m):
op.append(input().split())
for i in op:
j=int(i[1])
temp=[]
if i[0]=='0': #降序num[0]:num[i[1]]
temp=num[0:j]
temp.sort(reverse=True)
if j<n:
num=temp+num[j:]
else:
num=temp
else:
temp=num[(j-1):]
temp.sort()
num=num[0:j-1]+temp
for i in range(n):
print(num[i],end=' ')
12-22
03-26
872
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-29
1758
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)