//2017033-2
//学生排队
#include <iostream>
using namespace std;
int a[1005];
int n;
//查询该学号的同学所处的位置
int number(int i, int b[]){
for(int j=0; j<=n; j++){
if(b[j]==i)
return j;
}
}
int main()
{
int m;//n表示学生的数量,m表示调整的次数
cin >> n >> m;
for(int i=1; i<=n; i++)
a[i]=i;
for(int i=0; i<m; i++){
int p, q;
cin >> p >> q;//a表示学号,b表示向前移,还是向后移
int pos = number(p, a);//得到该学号的位置
int temp=pos;
if(q<0){
int u =a[temp];
for(int j=0; j<-q; j++){
a[temp]=a[temp-1];
temp--;
}
a[temp]=u;
}
else {
temp=pos;
int u =a[temp];
for(int j=0; j<q; j++){
a[temp]=a[temp+1];
temp++;
}
a[pos+q]=u;
}
}
for(int i=1; i<=n; i++)
cout << a[i] << " ";
return 0;
}