// In the name of God
// Code by: mrMaster

#include <bits/stdc++.h>

using namespace std;

#define int long long

int base;
vector<bool>v;
int odd , even;
int n,q;

void input()
{
	cin >>n >> q;
	int mod , x;
	for(int i=0;i<q;++i){
		cin >> mod;
		if(mod == 1){
			cin >> x;
			base = (base - x + 3*n)%n;
		}else
			v.push_back(base&1);
	}
}

void prep()
{
	for(int i=0;i<v.size();++i){
		if(v[i] == (i&1))
			++even;
		else
			--even;
	}
	for(int i=0;i<v.size();++i){
		if(v[i] == ((i+1)&1))
			++odd;
		else
			--odd;
	}
}

void output()
{
	for(int i=0;i<n;++i){
		int t = (base + i + 3*n)%n;
		if(t&1)
			cout << (t+odd+3*n)%n+1 << ' ';
		else
			cout << (t+even+3*n)%n+1 << ' ';
	}
	cout << endl;
}

main()
{
	input();
	prep();
	output();
	return 0;
}


// In the name of God
// Code by: mrMaster

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define boost ios_base :: sync_with_stdio(false) , cin.tie(0) , cout.tie(0)

const int MN = 1e6 + 10;

int base;
vector<bool>v;
int odd , even;
int n,q;
int res[MN];

void input()
{
	boost;
	cin >> n >> q;
	int mod , x;
	for(int i=0;i<q;++i){
		cin >> mod;
		if(mod == 1){
			cin >> x;
			base = (base - x + 2*n)%n;
		}else
			v.push_back(base&1);
	}
}

void prep()
{
	for(int i=0;i<v.size();++i){
		if(v[i] == (i&1))
			++even;
		else
			--even;
	}
	for(int i=0;i<v.size();++i){
		if(v[i] == ((i+1)&1))
			++odd;
		else
			--odd;
	}
}

void output()
{
	boost;
	int t;
	for(int i=0;i<n;++i){
		t = (base + i + 2*n)%n;
		if(t&1)
			res[(t+odd+2*MN*n)%n] = t;
		else
			res[(t+even+2*MN*n)%n] = t;
	}
	for(int i=0;i<n;++i){
		t = (base + i + 2*n)%n;
		cout << res[i]+1 << ' ';
	}
	cout << endl;
}

main()
{
	input();
	prep();
	output();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N = 1000006;

int ans[N];
int pre[N];

int main(){
    int n,k; cin >> n >> k;

    ll even = 0 , odd = 0;
    for(int i=1;i<=k;i++){
        int ty; cin >> ty;
        if(ty == 1){
            ll x; cin >> x;
            even += x; odd += x;
        }else{
            if(even % 2 == 0){
                even--;
                odd++;
            }else{
                even++;
                odd--;
            }
        }
    }

    for(int i=1;i<=n;i++) pre[i] = i;

    for(int i=1;i<=n;i++){
        if(i&1){
            ll id = (i + odd) % n;
            id = (id + n) % n;
            if(id == 0) id = n;
            ans[id] = pre[i];
        }else{
            ll id = (i + even) % n;
            id = (id + n) % n;
            if(id == 0) id = n;
            ans[id] = pre[i];
        }
    }

    for(int i=1;i<=n;i++) cout << ans[i] << " " ; puts("");

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N = 1000006;

int ans[N];
int pre[N];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

    int n,k; scanf("%d %d",&n,&k);

    ll even = 0 , odd = 0;
    for(int i=1;i<=k;i++){
        int ty; scanf("%d",&ty);
        if(ty == 1){
            ll x; scanf("%I64d",&x);
            even += x; odd += x;
        }else{
            if(even % 2 == 0){
                even--;
                odd++;
            }else{
                even++;
                odd--;
            }
        }
    }

    for(int i=1;i<=n;i++) pre[i] = i;

    for(int i=1;i<=n;i++){
        if(i&1){
            ll id = (i + odd) % n;
            id = (id + n) % n;
            if(id == 0) id = n;
            ans[id] = pre[i];
        }else{
            ll id = (i + even) % n;
            id = (id + n) % n;
            if(id == 0) id = n;
            ans[id] = pre[i];
        }
    }

    for(int i=1;i<=n;i++) printf("%I64d ",ans[i]); puts("");

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N = 1000006;

int ans[N];
int pre[N];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

    int n,k; scanf("%d %d",&n,&k);

    ll even = 0 , odd = 0;
    for(int i=1;i<=k;i++){
        int ty; scanf("%d",&ty);
        if(ty == 1){
            ll x; scanf("%I64d",&x);
            even += x; odd += x;
        }else{
            if(even % 2 == 0){
                even--;
                odd++;
            }else{
                even++;
                odd--;
            }
        }
    }

    for(int i=1;i<=n;i++) pre[i] = i;

    for(int i=1;i<=n;i++){
        if(i&1){
            ll id = (i + odd) % n;
            id = (id + n) % n;
            if(id == 0) id = n;
            ans[id] = pre[i];
        }else{
            ll id = (i + even) % n;
            id = (id + n) % n;
            if(id == 0) id = n;
            ans[id] = pre[i];
        }
    }

    for(int i=1;i<=n;i++) printf("%d ",ans[i]); puts("");

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N = 1000006;

int ans[N];
int pre[N];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

    int n,k; cin >> n >> k;

    ll even = 0 , odd = 0;
    for(int i=1;i<=k;i++){
        int ty; cin >> ty;
        if(ty == 1){
            ll x; cin >> x;
            even += x; odd += x;
        }else{
            if(even % 2 == 0){
                even--;
                odd++;
            }else{
                even++;
                odd--;
            }
        }
    }

    for(int i=1;i<=n;i++) pre[i] = i;

    for(int i=1;i<=n;i++){
        if(i&1){
            ll id = (i + odd) % n;
            id = (id + n) % n;
            if(id == 0) id = n;
            ans[id] = pre[i];
        }else{
            ll id = (i + even) % n;
            id = (id + n) % n;
            if(id == 0) id = n;
            ans[id] = pre[i];
        }
    }

    for(int i=1;i<=n;i++) cout << ans[i] << " " ; puts("");

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int arr[2000010],brr[2000010];

int main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
cout.tie(0);

int n,q,i,type;
cin>>n>>q;

long long odd=0;
long long even=0;
long long  x;

while(q--)
{
  cin>>type;
  if(type==1)
  {
     cin>>x;
     odd+=x;

     even+=x;

  }
  else
  {

    if(even&1)
    {
    even+=1;
       odd-=1;
    }
     else
     {

     even-=1;
        odd+=1;
     }
  }

}

long long gh = 1LL*100000000*n;

for(i=1;i<=n;i+=2)
{
   arr[i]=(i+odd+gh)%n;

   if(arr[i]==0)
     arr[i]=n;
}

for(i=2;i<=n;i+=2)
  {
    arr[i]=(i+even+gh)%n;

    if(arr[i]==0)
      arr[i]=n;
  }

  for(i=1;i<=n;i++)
  {
    brr[arr[i]]=i;
  }

 for(i=1;i<=n;i++)
   cout<<brr[i]<<" ";

}


#include<bits/stdc++.h>
using namespace std;

int arr[2000010],brr[2000010];

int main()
{

int n,q,i,type;
scanf("%d%d",&n,&q);
long long odd=0;
long long even=0;
long long  x;

while(q--)
{
 scanf("%d",&type);

  if(type==1)
  {
     scanf("%d",&x);

     odd+=x;

     even+=x;

  }
  else
  {

    if(even&1)
    {
    even+=1;
       odd-=1;
    }
     else
     {

     even-=1;
        odd+=1;
     }
  }

}

long long gh = 1LL*100000000*n;

for(i=1;i<=n;i+=2)
{
   arr[i]=(i+odd+gh)%n;

   if(arr[i]==0)
     arr[i]=n;
}

for(i=2;i<=n;i+=2)
  {
    arr[i]=(i+even+gh)%n;

    if(arr[i]==0)
      arr[i]=n;
  }

  for(i=1;i<=n;i++)
  {
    brr[arr[i]]=i;
  }

 for(i=1;i<=n;i++)
   printf("%d ",brr[i]);

}


#include<bits/stdc++.h>
using namespace std;

int arr[2000010],brr[2000010];

int main()
{

int n,q,i,type;
cin>>n>>q;

int odd=0;
int even=0;
int x;

while(q--)
{
  cin>>type;
  if(type==1)
  {
     cin>>x;
     odd+=x;
     odd%=n;

     even+=x;

     even%=n;

  }
  else
  {
     if(even%2==0)
     {
        even-=1;
        even=(even+n)%n;
        odd+=1;
        odd=(odd+n)%n;
     }
     else
     {
       even+=1;
        even=(even+n)%n;
       odd-=1;
        odd=(odd+n)%n;

     }
  }

}

for(i=1;i<=n;i+=2)
{
   arr[i]=(i+odd+n)%n;

   if(arr[i]==0)
     arr[i]=n;
}

for(i=2;i<=n;i+=2)
  {
    arr[i]=(i+even+n)%n;

    if(arr[i]==0)
      arr[i]=n;
  }

  for(i=1;i<=n;i++)
  {
    brr[arr[i]]=i;
  }

 for(i=1;i<=n;i++)
   cout<<brr[i]<<" ";

}


#include<bits/stdc++.h>
using namespace std;

int arr[2000010],brr[2000010];

int main()
{

int n,q,i,type;
scanf("%d%d",&n,&q);
long long odd=0;
long long even=0;
long long  x;

while(q--)
{
 scanf("%d",&type);

  if(type==1)
  {
     scanf("%d",&x);

     odd+=x;

     even+=x;

  }
  else
  {

    if(even&1)
    {
    even+=1;
       odd-=1;
    }
     else
     {

     even-=1;
        odd+=1;
     }
  }

}

long long gh = 1LL*100000000*n;

for(i=1;i<=n;i+=2)
{
   arr[i]=(i+odd+gh)%n;

   if(arr[i]==0)
     arr[i]=n;
}

for(i=2;i<=n;i+=2)
  {
    arr[i]=(i+even+gh)%n;

    if(arr[i]==0)
      arr[i]=n;
  }

  for(i=1;i<=n;i++)
  {
    brr[arr[i]]=i;
  }

 for(i=1;i<=n;i++)
  cout<<brr[i]<<" ";

}


#include<bits/stdc++.h>
using namespace std;

int arr[2000010],brr[2000010];

inline int inp()
{
    register int r=0,c;
    for(c=getchar_unlocked(); c<=32; c=getchar_unlocked());
    if(c=='-')
        return -inp();
    for(; c>32; r=(r<<1)+(r<<3)+c-'0',c=getchar_unlocked());
    return r;
}

int main()
{

int n,q,i,type;
n=inp();
q=inp();

long long odd=0;
long long even=0;
long long  x;

while(q--)
{
  type=inp();

  if(type==1)
  {
     x=inp();

     odd+=x;

     even+=x;

  }
  else
  {

    if(even&1)
    {
    even+=1;
       odd-=1;
    }
     else
     {

     even-=1;
        odd+=1;
     }
  }

}

long long gh = 1LL*100000000*n;

for(i=1;i<=n;i+=2)
{
   arr[i]=(i+odd+gh)%n;

   if(arr[i]==0)
     arr[i]=n;
}

for(i=2;i<=n;i+=2)
  {
    arr[i]=(i+even+gh)%n;

    if(arr[i]==0)
      arr[i]=n;
  }

  for(i=1;i<=n;i++)
  {
    brr[arr[i]]=i;
  }

 for(i=1;i<=n;i++)
   printf("%d ",brr[i]);

}


#include<bits/stdc++.h>
using namespace std;

int arr[2000010],brr[2000010];

int main()
{

int n,q,i,type;
cin>>n>>q;

long long odd=0;
long long even=0;
long long  x;

while(q--)
{
  cin>>type;
  if(type==1)
  {
     cin>>x;
     odd+=x;

     even+=x;

  }
  else
  {

    if(even&1)
    {
    even+=1;
       odd-=1;
    }
     else
     {

     even-=1;
        odd+=1;
     }
  }

}

long long gh = 1LL*100000000*n;

for(i=1;i<=n;i+=2)
{
   arr[i]=(i+odd+gh)%n;

   if(arr[i]==0)
     arr[i]=n;
}

for(i=2;i<=n;i+=2)
  {
    arr[i]=(i+even+gh)%n;

    if(arr[i]==0)
      arr[i]=n;
  }

  for(i=1;i<=n;i++)
  {
    brr[arr[i]]=i;
  }

 for(i=1;i<=n;i++)
   cout<<brr[i]<<" ";

}


#include<bits/stdc++.h>
using namespace std;

int arr[2000010],brr[2000010];

int main()
{

int n,q,i,type;
scanf("%d%d",&n,&q);
long long odd=0;
long long even=0;
int x;

while(q--)
{
 scanf("%d",&type);

  if(type==1)
  {
     scanf("%d",&x);

     odd+=x;

     even+=x;

  }
  else
  {

    if(even&1)
    {
    even+=1;
       odd-=1;
    }
     else
     {

     even-=1;
        odd+=1;
     }
  }

}

long long gh = 1LL*100000000*n;

for(i=1;i<=n;i+=2)
{
   arr[i]=(i+odd+gh)%n;

   if(arr[i]==0)
     arr[i]=n;
}

for(i=2;i<=n;i+=2)
  {
    arr[i]=(i+even+gh)%n;

    if(arr[i]==0)
      arr[i]=n;
  }

  for(i=1;i<=n;i++)
  {
    brr[arr[i]]=i;
  }

 for(i=1;i<=n;i++)
   printf("%d ",brr[i]);

}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<climits>
#include<cstring>
#include<list>
#include<fstream>
#include<queue>
#include<sstream>
#include<stack>
#include<iomanip>

using namespace std;
typedef long long LL;

LL mod=1e9+7;

int arr[1000005];
vector <pair<int, int> > coms(2000006);

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n, q;
    scanf("%d", &n);
    scanf("%d", &q);

    int odd=0, even=0;

    int flag=0;

    for(int i=1; i<=q; i++)
    {

        int t;
        scanf("%d", &t);

        if(t==1)
        {
            int x;
            scanf("%d", &x);

            if(x<0)
                x=(x+n)%n;

            odd= (odd+x+n)%n;
            even= (even+x+n)%n;

            if(x%2==1)
                flag=!flag;

        }
        else
        {
            if(flag==1)
            {
                odd+=1;
                even-=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
            else
            {
                odd-=1;
                even+=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
        }

        //cout<<even<<' '<<odd<<'\n';

    }

    for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            int ind= (i+even+n)%n;
            arr[ind]=i;
        }
        else
        {
            int ind= (i+odd+n)%n;
            arr[ind]=i;
        }
    }

    for(int i=0; i<n; i++)
        printf("%d ", arr[i]+1);

}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<climits>
#include<cstring>
#include<list>
#include<fstream>
#include<queue>
#include<sstream>
#include<stack>
#include<iomanip>

using namespace std;
typedef long long LL;

LL mod=1e9+7;

int arr[1000005];

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n, q;
    cin>>n>>q;

    int odd=0, even=0;

    int flag=0;

    for(int i=1; i<=q; i++)
    {
        int t;
        cin>>t;

        if(t==1)
        {
            int x;
            cin>>x;

            if(x<0)
                x=n-x;

            odd= (odd+x)%n;
            even= (even+x)%n;

            if(x%2==1)
                flag=!flag;

        }
        else
        {
            if(flag==1)
            {
                odd+=1;
                even-=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
            else
            {
                odd-=1;
                even+=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
        }
    }

    for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            int ind= (i+even)%n;
            arr[ind]=i;
        }
        else
        {
            int ind= (i+odd)%n;
            arr[ind]=i;
        }
    }

    for(int i=0; i<n; i++)
        cout<<arr[i]+1<<' ';

}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<climits>
#include<cstring>
#include<list>
#include<fstream>
#include<queue>
#include<sstream>
#include<stack>
#include<iomanip>

using namespace std;
typedef long long LL;

LL mod=1e9+7;

int arr[1000005];

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n, q;
    cin>>n>>q;

    int odd=0, even=0;

    int flag=0;

    for(int i=1; i<=q; i++)
    {
        int t;
        cin>>t;

        if(t==1)
        {
            int x;
            cin>>x;

            if(x<0)
                x=(x+n)%n;

            odd= (odd+x+n)%n;
            even= (even+x+n)%n;

            if(x%2==1)
                flag=!flag;

        }
        else
        {
            if(flag==1)
            {
                odd+=1;
                even-=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
            else
            {
                odd-=1;
                even+=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
        }

        //cout<<even<<' '<<odd<<'\n';

    }

    for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            int ind= (i+even+n)%n;
            arr[ind]=i;
        }
        else
        {
            int ind= (i+odd+n)%n;
            arr[ind]=i;
        }
    }

    for(int i=0; i<n; i++)
        cout<<arr[i]+1<<' ';

}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<climits>
#include<cstring>
#include<list>
#include<fstream>
#include<queue>
#include<sstream>
#include<stack>
#include<iomanip>

using namespace std;
typedef long long LL;

LL mod=1e9+7;

int arr[1000005];
vector <pair<int, int> > coms(2000006);

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n, q;
    cin>>n>>q;

    int odd=0, even=0;

    int flag=0;

    for(int i=1; i<=q; i++)
    {
        cin>>coms[i].first;
        if(coms[i].first==1)
            cin>>coms[i].second;
    }

    for(int i=1; i<=q; i++)
    {

        if(coms[i].first==1)
        {
            int x=coms[i].second;

            if(x<0)
                x=(x+n)%n;

            odd= (odd+x+n)%n;
            even= (even+x+n)%n;

            if(x%2==1)
                flag=!flag;

        }
        else
        {
            if(flag==1)
            {
                odd+=1;
                even-=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
            else
            {
                odd-=1;
                even+=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
        }

        //cout<<even<<' '<<odd<<'\n';

    }

    for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            int ind= (i+even+n)%n;
            arr[ind]=i;
        }
        else
        {
            int ind= (i+odd+n)%n;
            arr[ind]=i;
        }
    }

    for(int i=0; i<n; i++)
        cout<<arr[i]+1<<' ';

}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<climits>
#include<cstring>
#include<list>
#include<fstream>
#include<queue>
#include<sstream>
#include<stack>
#include<iomanip>

using namespace std;
typedef long long LL;

LL mod=1e9+7;

int arr[1000005];

int main()
{

    ios_base::sync_with_stdio(false);
    //cin.tie(0);

    int n, q;
    cin>>n>>q;

    int odd=0, even=0;

    int flag=0;

    for(int i=1; i<=q; i++)
    {
        int t;
        cin>>t;

        if(t==1)
        {
            int x;
            cin>>x;

            if(x<0)
                x=(x+n)%n;

            odd= (odd+x+n)%n;
            even= (even+x+n)%n;

            if(x%2==1)
                flag=!flag;

        }
        else
        {
            if(flag==1)
            {
                odd+=1;
                even-=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
            else
            {
                odd-=1;
                even+=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
        }

        //cout<<even<<' '<<odd<<'\n';

    }

    for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            int ind= (i+even+n)%n;
            arr[ind]=i;
        }
        else
        {
            int ind= (i+odd+n)%n;
            arr[ind]=i;
        }
    }

    for(int i=0; i<n; i++)
        cout<<arr[i]+1<<' ';

}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<climits>
#include<cstring>
#include<list>
#include<fstream>
#include<queue>
#include<sstream>
#include<stack>
#include<iomanip>

using namespace std;
typedef long long LL;

LL mod=1e9+7;

int arr[1000005];
vector <pair<int, int> > coms(2000006);

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n, q;
    cin>>n>>q;

    int odd=0, even=0;

    int flag=0;

    for(int i=1; i<=q; i++)
    {
        scanf("%d",&coms[i].first);
        if(coms[i].first==1)
            scanf("%d",&coms[i].second);
    }

    for(int i=1; i<=q; i++)
    {

        if(coms[i].first==1)
        {
            int x=coms[i].second;

            if(x<0)
                x=(x+n)%n;

            odd= (odd+x+n)%n;
            even= (even+x+n)%n;

            if(x%2==1)
                flag=!flag;

        }
        else
        {
            if(flag==1)
            {
                odd+=1;
                even-=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
            else
            {
                odd-=1;
                even+=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
        }

        //cout<<even<<' '<<odd<<'\n';

    }

    for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            int ind= (i+even+n)%n;
            arr[ind]=i;
        }
        else
        {
            int ind= (i+odd+n)%n;
            arr[ind]=i;
        }
    }

    for(int i=0; i<n; i++)
        printf("%d ", arr[i]+1);

}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<climits>
#include<cstring>
#include<list>
#include<fstream>
#include<queue>
#include<sstream>
#include<stack>
#include<iomanip>

using namespace std;
typedef long long LL;

LL mod=1e9+7;

int arr[1000005];

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n, q;
    cin>>n>>q;

    int odd=0, even=0;

    int flag=0;

    for(int i=1; i<=q; i++)
    {
        int t;
        cin>>t;

        if(t==1)
        {
            int x;
            cin>>x;

            odd= (odd+x+n)%n;
            even= (even+x+n)%n;

            if(x%2==1)
                flag=!flag;

        }
        else
        {
            if(flag==1)
            {
                odd+=1;
                even-=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
            else
            {
                odd-=1;
                even+=1;
                odd=(odd+n)%n;
                even=(even+n)%n;
                flag=!flag;
            }
        }
    }

    cout<<even<<' '<<odd<<'\n';

    for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            int ind= (i+odd+n)%n;
            arr[ind]=i;
        }
        else
        {
            int ind= (i+even+n)%n;
            arr[ind]=i;
        }
    }

    for(int i=0; i<n; i++)
        cout<<arr[i]+1<<' ';

}


#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
int main()
{
    int n,p,a=1,b=2,x,y;
    cin>>n>>p;
    while(p--)
    {
        int a1=a;
        scanf("%d",&x);
        if(x==2)
        {
            a^=b^=a^=b;
            continue;
        }
        scanf("%d",&y);
        if(y&1) a=b-y-1,b=a1-y+1;
        else a-=y,b-=y;
        if(a<=0)
        {
            int k=ceil(-(double)a/(double)n);
            a+=k*n;
            if(a==0) a=n;
        }
        if(b<=0)
        {
            int k=ceil(-(double)b/(double)n);
            b+=k*n;
            if(b==0) b=n;
        }
        if(a>n)
        {
            int k=ceil(((double)a-(double)n)/(double)n);
            a-=k*n;
        }
        if(b>n)
        {
            int k=ceil(((double)b-(double)n)/(double)n);
            b-=k*n;
        }
    }
    cout<<a<<" "<<b;
    for(int i=3; i<=n; i++)
        if(i&1)
        {
            a+=2;
            if(a>n)  a-=n;
            cout<<" "<<a;
        }
        else
        {
            b+=2;
            if(b>n)  b-=n;
            cout<<" "<<b;
        }
    cout<<endl;
}


#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    int n,p,a=1,b=2,x,y;
    cin>>n>>p;
    while(p--)
    {
        int a1=a;
        cin>>x;
        if(x==2)
        {
            a^=b^=a^=b;
            continue;
        }
        cin>>y;
        if(y&1) a=b-y-1,b=a1-y+1;
        else a-=y,b-=y;
        while(a<=0) a+=n;
        while(b<=0) b+=n;
        while(a>n)  a-=n;
        while(b>n)  b-=n;
    }
    cout<<a<<" "<<b;
    for(int i=3;i<=n;i++)
        if(i&1)
        {
            a+=2;
            if(a>n)  a-=n;
            cout<<" "<<a;
        }
        else
        {
            b+=2;
            if(b>n)  b-=n;
            cout<<" "<<b;
        }
    cout<<endl;
}


#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
int main()
{
    int n,p,a=1,b=2,x,y;
    cin>>n>>p;
    while(p--)
    {
        int a1=a;
        cin>>x;
        if(x==2)
        {
            a^=b^=a^=b;
            continue;
        }
        cin>>y;
        if(y&1) a=b-y-1,b=a1-y+1;
        else a-=y,b-=y;
        while(a<=0) a+=n;
        while(b<=0) b+=n;
        while(a>n)  a-=n;
        while(b>n)  b-=n;
    }
    cout<<a<<" "<<b;
    for(int i=3;i<=n;i++)
        if(i&1)
        {
            a+=2;
            if(a>n)  a-=n;
            cout<<" "<<a;
        }
        else
        {
            b+=2;
            if(b>n)  b-=n;
            cout<<" "<<b;
        }
    cout<<endl;
}


#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
int main()
{
    int n,p,a=1,b=2,x,y;
    cin>>n>>p;
    while(p--)
    {
        int a1=a;
        scanf("%d",&x);
        if(x==2)
        {
            a^=b^=a^=b;
            continue;
        }
        scanf("%d",&y);
        if(y&1) a=b-y-1,b=a1-y+1;
        else a-=y,b-=y;
        while(a<=0) a+=n;
        while(b<=0) b+=n;
        while(a>n)  a-=n;
        while(b>n)  b-=n;
    }
    cout<<a<<" "<<b;
    for(int i=3; i<=n; i++)
        if(i&1)
        {
            a+=2;
            if(a>n)  a-=n;
            cout<<" "<<a;
        }
        else
        {
            b+=2;
            if(b>n)  b-=n;
            cout<<" "<<b;
        }
    cout<<endl;
}


#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
int main()
{
    int n,p,a=1,b=2,x,y;
    cin>>n>>p;
    while(p--)
    {
        int a1=a;
        cin>>x;
        if(x==2)
        {
            a^=b^=a^=b;
            continue;
        }
        cin>>y;
        if(y&1) a=b-y-1,b=a1-y+1;
        else a-=y,b-=y;
    }
    if(a<=0)
    {
        int k=ceil(-(double)a/(double)n);
        a+=k*n;
        if(a==0) a=n;
    }
    if(b<=0)
    {
        int k=ceil(-(double)b/(double)n);
        b+=k*n;
        if(b==0) b=n;
    }
    if(a>n)
    {
        int k=ceil(((double)a-(double)n)/(double)n);
        a-=k*n;
    }
    if(b>n)
    {
        int k=ceil(((double)b-(double)n)/(double)n);
        b-=k*n;
    }
    cout<<a<<" "<<b;
    for(int i=3;i<=n;i++)
        if(i&1)
        {
            a+=2;
            if(a>n)  a-=n;
            cout<<" "<<a;
        }
        else
        {
            b+=2;
            if(b>n)  b-=n;
            cout<<" "<<b;
        }
    cout<<endl;
}


#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
int main()
{
    int n,p,a=1,b=2,x,y;
    cin>>n>>p;
    while(p--)
    {
        int a1=a;
        scanf("%d",&x);
        if(x==2)
        {
            a^=b^=a^=b;
            continue;
        }
        scanf("%d",&y);
        if(y&1) a=b-y-1,b=a1-y+1;
        else a-=y,b-=y;
    }
    if(a<=0)
    {
        int k=ceil(-(double)a/(double)n);
        a+=k*n;
        if(a==0) a=n;
    }
    if(b<=0)
    {
        int k=ceil(-(double)b/(double)n);
        b+=k*n;
        if(b==0) b=n;
    }
    if(a>n)
    {
        int k=ceil(((double)a-(double)n)/(double)n);
        a-=k*n;
    }
    if(b>n)
    {
        int k=ceil(((double)b-(double)n)/(double)n);
        b-=k*n;
    }
    cout<<a<<" "<<b;
    for(int i=3;i<=n;i++)
        if(i&1)
        {
            a+=2;
            if(a>n)  a-=n;
            cout<<" "<<a;
        }
        else
        {
            b+=2;
            if(b>n)  b-=n;
            cout<<" "<<b;
        }
    cout<<endl;
}


#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
int main()
{
    int n,p,a=1,b=2,x,y;
    cin>>n>>p;
    while(p--)
    {
        int a1=a;
        scanf("%d",&x);
        if(x==2)
        {
            a^=b^=a^=b;
            continue;
        }
        scanf("%d",&y);
        if(y&1) a=b-y-1,b=a1-y+1;
        else a-=y,b-=y;
    }
    while(a<=0) a+=n;
    while(b<=0) b+=n;
    while(a>n)  a-=n;
    while(b>n)  b-=n;
    cout<<a<<" "<<b;
    for(int i=3; i<=n; i++)
        if(i&1)
        {
            a+=2;
            if(a>n)  a-=n;
            cout<<" "<<a;
        }
        else
        {
            b+=2;
            if(b>n)  b-=n;
            cout<<" "<<b;
        }
    cout<<endl;
}


#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
int main()
{
    int n,p,a=1,b=2,x,y;
    cin>>n>>p;
    while(p--)
    {
        int a1=a;
        cin>>x;
        if(x==2)
        {
            a^=b^=a^=b;
            continue;
        }
        cin>>y;
        if(y&1) a=b-y-1,b=a1-y+1;
        else a-=y,b-=y;
    }
    while(a<=0) a+=n;
    while(b<=0) b+=n;
    while(a>n)  a-=n;
    while(b>n)  b-=n;
    cout<<a<<" "<<b;
    for(int i=3;i<=n;i++)
        if(i&1)
        {
            a+=2;
            if(a>n)  a-=n;
            cout<<" "<<a;
        }
        else
        {
            b+=2;
            if(b>n)  b-=n;
            cout<<" "<<b;
        }
    cout<<endl;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
  int a[1000001];
  int n, q, pos_I = 1, pos_II = 2, move, x, y;
int main(){
	//a[1] = 1; a[2] = 2;
	cin >> n >> q;
	for(int i = 1; i <= q; i++){
		scanf("%d", &x);
		if(x == 1){
			scanf("%d", &y);
		    move += y;
		}
		else{
			if(abs(move) != n){
			move %= n;
			if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else
			if (move < 0){
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			if(pos_I % 2){
			   pos_I++;
			   pos_II--;
		    }
		    else{
		    	pos_I--;
		    	pos_II++;
		    }
		}
		move = 0;
	  }
	}
	if(move){
		if(abs(move) > n)
		   move %= n;
		if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else{
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
	}
	int z = pos_I;
	int val = 1;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_I % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n-1){
		a[z] = val;
		val += 2;
		z += 2;
	}

    z = pos_II;
	val = 2;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_II % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}

	for(int i = 1; i <= n; i++)
	    printf("%d ", a[i]);

 return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
  int a[1000001];
  int n, q, pos_I = 1, pos_II = 2, move, x, y;
int main(){
	//a[1] = 1; a[2] = 2;
	cin >> n >> q;
	for(int i = 1; i <= q; i++){
		scanf("%d", &x);
		if(x == 1){
			scanf("%d", &y);
		    move += y;
		}
		else{
			move %= n;
			if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else
			if (move < 0){
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			if(pos_I % 2){
			   pos_I++;
			   pos_II--;
		    }
		    else{
		    	pos_I--;
		    	pos_II++;
		    }
		}
	}
	if(move){
		if(abs(move) > n)
		   move %= n;
		if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else{
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
	}
	int z = pos_I;
	int val = 1;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_I % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n-1){
		a[z] = val;
		val += 2;
		z += 2;
	}

    z = pos_II;
	val = 2;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_II % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}

	for(int i = 1; i <= n; i++)
	    printf("%d ", a[i]);

 return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
  int a[1000001];
  int n, q, pos_I = 1, pos_II = 2, move, x, y;
int main(){
	//a[1] = 1; a[2] = 2;
	cin >> n >> q;
	for(int i = 1; i <= q; i++){
		scanf("%d", &x);
		if(x == 1){
			scanf("%d", &y);
		    move += y;
		}
		else{
			move %= n;
			if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else{
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			if(pos_I % 2){
			   pos_I++;
			   pos_II--;
		    }
		    else{
		    	pos_I--;
		    	pos_II++;
		    }
		}
	}
	if(move){
		if(abs(move) > n)
		   move %= n;
		if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else{
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
	}
	int z = pos_I;
	int val = 1;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_I % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n-1){
		a[z] = val;
		val += 2;
		z += 2;
	}

    z = pos_II;
	val = 2;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_II % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}

	for(int i = 1; i <= n; i++)
	    printf("%d ", a[i]);

 return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
  int a[1000001];
  long long n, q, pos_I = 1, pos_II = 2, move, x, y;
int main(){
	//a[1] = 1; a[2] = 2;
	cin >> n >> q;
	for(int i = 1; i <= q; i++){
		scanf("%d", &x);
		if(x == 1){
			scanf("%d", &y);
		    move += y;
		}
		else{
			move %= n;
			if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else
			if (move < 0){
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			if(pos_I % 2){
			   pos_I++;
			   pos_II--;
		    }
		    else{
		    	pos_I--;
		    	pos_II++;
		    }
		}
	}
	if(move){
		if(abs(move) > n)
		   move %= n;
		if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else{
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
	}
	int z = pos_I;
	int val = 1;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_I % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n-1){
		a[z] = val;
		val += 2;
		z += 2;
	}

    z = pos_II;
	val = 2;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_II % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}

	for(int i = 1; i <= n; i++)
	    printf("%d ", a[i]);

 return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
  int a[1000001];
  int n, q, pos_I = 1, pos_II = 2, move, x, y;
int main(){
	//a[1] = 1; a[2] = 2;
	cin >> n >> q;
	for(int i = 1; i <= q; i++){
		scanf("%d", &x);
		if(x == 1){
			scanf("%d", &y);
		    move += y;
		}
		else{
			if(abs(move) != n){
			move %= n;
			if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else
			if (move < 0){
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			if(pos_I % 2){
			   pos_I++;
			   pos_II--;
		    }
		    else{
		    	pos_I--;
		    	pos_II++;
		    }
		}
	  }
	}
	if(move){
		if(abs(move) > n)
		   move %= n;
		if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else{
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
	}
	int z = pos_I;
	int val = 1;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_I % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n-1){
		a[z] = val;
		val += 2;
		z += 2;
	}

    z = pos_II;
	val = 2;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_II % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}

	for(int i = 1; i <= n; i++)
	    printf("%d ", a[i]);

 return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
  int a[1000001];
  int n, q, pos_I = 1, pos_II = 2, move, x, y;
int main(){
	//a[1] = 1; a[2] = 2;
	cin >> n >> q;
	for(int i = 1; i <= q; i++){
		scanf("%d", &x);
		if(x == 1){
			scanf("%d", &y);
		    move += y;
		}
		else{
			if(abs(move) != n){
			move %= n;
			if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else
			if (move < 0){
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
		}
			if(pos_I % 2){
			   pos_I++;
			   pos_II--;
		    }
		    else{
		    	pos_I--;
		    	pos_II++;
		    }

		move = 0;
	  }
	}
	if(move){
		if(abs(move) > n)
		   move %= n;
		if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else{
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
	}
	int z = pos_I;
	int val = 1;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_I % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n-1){
		a[z] = val;
		val += 2;
		z += 2;
	}

    z = pos_II;
	val = 2;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_II % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}

	for(int i = 1; i <= n; i++)
	    printf("%d ", a[i]);

 return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
  int a[1000001];
  int n, q, pos_I = 1, pos_II = 2, move, x, y;
int main(){
	//a[1] = 1; a[2] = 2;
	cin >> n >> q;
	for(int i = 1; i <= q; i++){
		scanf("%d", &x);
		if(x == 1){
			scanf("%d", &y);
		    move += y;
		    move %= n;
		}
		else{
			move %= n;
			if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else
			if (move < 0){
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			if(pos_I % 2){
			   pos_I++;
			   pos_II--;
		    }
		    else{
		    	pos_I--;
		    	pos_II++;
		    }
		}
	}
	if(move){
		if(abs(move) > n)
		   move %= n;
		if(move > 0){
				pos_I += move;
				pos_II += move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
			else{
				pos_I += n + move;
				pos_II += n + move;
				move = 0;
				if(pos_I > n)
				   pos_I %= n;
				if(pos_II > n)
				   pos_II %= n;
			}
	}
	int z = pos_I;
	int val = 1;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_I % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n-1){
		a[z] = val;
		val += 2;
		z += 2;
	}

    z = pos_II;
	val = 2;
	while(z <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}
	if(pos_II % 2)
	   z = 1;
	else
	   z = 2;
	while(val <= n){
		a[z] = val;
		val += 2;
		z += 2;
	}

	for(int i = 1; i <= n; i++)
	    printf("%d ", a[i]);

 return 0;
}


#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))

#define MOD 1000000007

int d[1000005];

int main(){
  int n,q;
  cin>>n>>q;
  int p1 = 0;
  int p2 = 1;
  rep(i,0,q){
    int t;
    cin>>t;
    if(t==2){
      if(p1%2==0){
        p1++;
      }
      else{
        p1--;
      }
      if(p2%2==0){
        p2++;
      }
      else{
        p2--;
      }
    }
    else{
      int x;
      cin>>x;
      p1+=n;
      p2+=n;
      p1+=x;
      p2+=x;
      p1%=n;
      p2%=n;
    }
    cout << p1+1 << " " << p2+1 << endl;
  }
  rep(i,0,n/2){
    d[(p1+i*2)%n] = i*2+1;
  }
  rep(i,0,n/2){
    d[(p2+i*2)%n] = i*2+2;
  }
  rep(i,0,n){
    cout << d[i];
    if(i!=n-1)cout << " ";
  }
  cout << endl;
  return 0;
}


#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))

#define MOD 1000000007

int d[1000005];

int main(){
  long long n,q;
  cin>>n>>q;
  long long p1 = n*2000000;
  long long p2 = n*2000000+1;
  rep(i,0,q){
    int t;
    cin>>t;
    if(t==2){
      if((p1&1)==0){
        p1++;
      }
      else{
        p1--;
      }
      if((p2&1)==0){
        p2++;
      }
      else{
        p2--;
      }
    }
    else{
      int x;
      cin>>x;
      p1+=x;
      p2+=x;
    }
  }
  p1%=n;
  p2%=n;
  rep(i,0,n/2){
    d[(p1+i*2)%n] = i*2+1;
  }
  rep(i,0,n/2){
    d[(p2+i*2)%n] = i*2+2;
  }
  rep(i,0,n){
    cout << d[i];
    if(i!=n-1)cout << " ";
  }
  cout << endl;
  return 0;
}


#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))

#define MOD 1000000007

int d[1000005];

int main(){
  int n,q;
  cin>>n>>q;
  int p1 = 0;
  int p2 = 1;
  rep(i,0,q){
    int t;
    cin>>t;
    if(t==2){
      if(p1%2==0){
        p1++;
      }
      else{
        p1--;
      }
      if(p2%2==0){
        p2++;
      }
      else{
        p2--;
      }
    }
    else{
      int x;
      cin>>x;
      p1+=n;
      p2+=n;
      p1+=x;
      p2+=x;
      p1%=n;
      p2%=n;
    }
  }
  rep(i,0,n/2){
    d[(p1+i*2)%n] = i*2+1;
  }
  rep(i,0,n/2){
    d[(p2+i*2)%n] = i*2+2;
  }
  rep(i,0,n){
    cout << d[i];
    if(i!=n-1)cout << " ";
  }
  cout << endl;
  return 0;
}


#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))

#define MOD 1000000007

int d[1000005];

int main(){
  long long n,q;
  cin>>n>>q;
  long long p1 = n*2000000;
  long long p2 = n*2000000+1;
  rep(i,0,q){
    int t;
    scanf("%d", &t);
    if(t==2){
      if((p1&1)==0){
        p1++;
      }
      else{
        p1--;
      }
      if((p2&1)==0){
        p2++;
      }
      else{
        p2--;
      }
    }
    else{
      int x;
      scanf("%d", &x);
      p1+=x;
      p2+=x;
    }
  }
  p1%=n;
  p2%=n;
  rep(i,0,n/2){
    d[(p1+i*2)%n] = i*2+1;
  }
  rep(i,0,n/2){
    d[(p2+i*2)%n] = i*2+2;
  }
  rep(i,0,n){
    cout << d[i];
    if(i!=n-1)cout << " ";
  }
  cout << endl;
  return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define sc scanf
#define pf printf
using namespace std;

struct cmp
{
    bool operator()(pii a ,pii b){
        return a.second > b.second;
    }
};

ll modpow(ll base, ll exp, ll mod)
{
  base %= mod;
  ll result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % mod;
    base = (base * base) % mod;
    exp >>= 1;
  }
  return result;
}

int ans[1000005];

bool cmpr(pii a, pii b)
{
	return a.second < b.second;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	//freopen("C:/Users/HP/Desktop/codejam/1A_large_input.txt","r",stdin);//redirects standard input
	//freopen("C:/Users/HP/Desktop/codejam/1A_large_output.txt","w",stdout);//redirects standard output
	int n,q,t,x;
	cin>>n>>q;
	int even=0,odd=0;
	while(q--)
	{
		cin>>t;
		if(t==1) {
			cin>>x;
			even=(even+x+n)%n;
			odd=(odd+x+n)%n;
		}
		else {
			if(even&1) {
				even-=1;
			}
			else {
				even+=1;
			}
			if(odd&1) {
				odd+=1;
			}
			else {
				odd-=1;
			}
		}
	}

	//cout<<" "<<even<<" "<<odd<<" "<<endl;
	for(int i=0; i<n; i++)
	{
		if(i&1) ans[(i+odd+n)%n]=i;
		else ans[(i+even+n)%n]=i;
	}

	for(int i=0; i<n; i++)
	{
		cout<<1+ans[i]<<" ";
	}
	cout<<endl;

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define sc scanf
#define pf printf
using namespace std;

struct cmp
{
    bool operator()(pii a ,pii b){
        return a.second > b.second;
    }
};

ll modpow(ll base, ll exp, ll mod)
{
  base %= mod;
  ll result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % mod;
    base = (base * base) % mod;
    exp >>= 1;
  }
  return result;
}

vector<pii> ans;

bool cmpr(pii a, pii b)
{
	return a.second < b.second;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	//freopen("C:/Users/HP/Desktop/codejam/1A_large_input.txt","r",stdin);//redirects standard input
	//freopen("C:/Users/HP/Desktop/codejam/1A_large_output.txt","w",stdout);//redirects standard output
	int n,q,t,x;
	cin>>n>>q;
	int even=0,odd=0;
	while(q--)
	{
		cin>>t;
		if(t==1) {
			cin>>x;
			even=(even+x+n)%n;
			odd=(odd+x+n)%n;
		}
		else {
			if(even&1) {
				even-=1;
			}
			else {
				even+=1;
			}
			if(odd&1) {
				odd+=1;
			}
			else {
				odd-=1;
			}
		}
	}

	//cout<<" "<<even<<" "<<odd<<" "<<endl;
	for(int i=0; i<n; i++)
	{
		if(i&1) ans.pb(mp(i,(i+odd)%n));
		else ans.pb(mp(i,(i+even)%n));
	}
	sort(ans.begin(),ans.end(),cmpr);
	/*for(int i=0; i<n; i++)
	{
		cout<<" "<<ans[i].first<<" "<<ans[i].second<<endl;
	}*/
	for(int i=0; i<n; i++)
	{
		cout<<ans[i].first+1<<" ";
	}
	cout<<endl;

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define sc scanf
#define pf printf
using namespace std;

struct cmp
{
    bool operator()(pii a ,pii b){
        return a.second > b.second;
    }
};

ll modpow(ll base, ll exp, ll mod)
{
  base %= mod;
  ll result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % mod;
    base = (base * base) % mod;
    exp >>= 1;
  }
  return result;
}

int ans[1000005];

bool cmpr(pii a, pii b)
{
	return a.second < b.second;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	//freopen("C:/Users/HP/Desktop/codejam/1A_large_input.txt","r",stdin);//redirects standard input
	//freopen("C:/Users/HP/Desktop/codejam/1A_large_output.txt","w",stdout);//redirects standard output
	int n,q,t,x;
	//cin>>n>>q;
	sc("%d %d",&n,&q);
	int even=0,odd=0;
	while(q--)
	{
		//cin>>t;
		sc("%d",&t);
		if(t==1) {
			//cin>>x;
			sc("%d",&x);
			even=(even+x+n)%n;
			odd=(odd+x+n)%n;
		}
		else {
			if(even&1) {
				even-=1;
			}
			else {
				even+=1;
			}
			if(odd&1) {
				odd+=1;
			}
			else {
				odd-=1;
			}
		}
	}

	//cout<<" "<<even<<" "<<odd<<" "<<endl;
	for(int i=0; i<n; i++)
	{
		if(i&1) ans[(i+odd+n)%n]=i;
		else ans[(i+even+n)%n]=i;
	}

	for(int i=0; i<n; i++)
	{
		//cout<<1+ans[i]<<" ";
		pf("%d ",1+ans[i]);
	}
	//cout<<endl;
	pf("\n");

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define sc scanf
#define pf printf
using namespace std;

struct cmp
{
    bool operator()(pii a ,pii b){
        return a.second > b.second;
    }
};

ll modpow(ll base, ll exp, ll mod)
{
  base %= mod;
  ll result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % mod;
    base = (base * base) % mod;
    exp >>= 1;
  }
  return result;
}

vector<pii> ans;

bool cmpr(pii a, pii b)
{
	return a.second < b.second;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	//freopen("C:/Users/HP/Desktop/codejam/1A_large_input.txt","r",stdin);//redirects standard input
	//freopen("C:/Users/HP/Desktop/codejam/1A_large_output.txt","w",stdout);//redirects standard output
	int n,q,t,x;
	//cin>>n>>q;
	sc("%d %d",&n,&q);
	int even=0,odd=0;
	while(q--)
	{
		//cin>>t;
		sc("%d",&t);
		if(t==1) {
			//cin>>x;
			sc("%d",&x);
			even=(even+x+n)%n;
			odd=(odd+x+n)%n;
		}
		else {
			if(even&1) {
				even-=1;
			}
			else {
				even+=1;
			}
			if(odd&1) {
				odd+=1;
			}
			else {
				odd-=1;
			}
		}
	}

	//cout<<" "<<even<<" "<<odd<<" "<<endl;
	for(int i=0; i<n; i++)
	{
		if(i&1) ans.pb(mp(i,(i+odd)%n));
		else ans.pb(mp(i,(i+even)%n));
	}
	sort(ans.begin(),ans.end(),cmpr);
	/*for(int i=0; i<n; i++)
	{
		cout<<" "<<ans[i].first<<" "<<ans[i].second<<endl;
	}*/
	for(int i=0; i<n; i++)
	{
		//cout<<ans[i].first+1<<" ";
		pf("%d ",1+ans[i].first);
	}
	//cout<<endl;
	pf("\n");

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define inf (1<<30)-1
#define INF (1LL<<62)-1
#define MOD 1000000007LL
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define PI acos(-1)
#define MEM(x,y) memset(x,y,sizeof (x))
#define debug cout<<"A"<<'\n'
#define REP(i,a,b) for (int i=(a); i<=(b); i++)
#define PER(i,a,b) for (int i=(a); i>=(b); i--)
#define REPL(i,a,b) for (LL i=(a); i<=(b); i++)
#define PERL(i,a,b) for (LL i=(a); i>=(b); i--)
#define print(x) cout<<x<<'\n'
#define dprint(a,x) cout<<setprecision(x)<<fixed<<a<<'\n'
#define itrALL(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int>PII;
typedef pair<LL,LL>PLL;
typedef set<int> SI;
typedef set<LL> SL;
typedef set<string> SS;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef map<int,int> MII;
typedef map<LL,LL> MLL;
typedef queue<int> QI;

/* Direction Array */

// int fx[]={1,-1,0,0};
// int fy[]={0,0,1,-1};
// int fx[]={0,0,1,-1,-1,1,-1,1};
// int fy[]={-1,1,0,0,1,1,-1,-1};

template <class T> inline T bigmod(T p,T e,T M)
{
    T ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}

template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}
template <class T> inline T lcm(T a,T b) {a=abs(a);b=abs(b); return (a/gcd(a,b))*b;}
template <class T, class X> inline bool getbit(T a, X i) { T t=1; return ((a&(t<<i))>0);}
template <class T, class X> inline T setbit(T a, X i) { T t=1;return (a|(t<<i)); }
template <class T, class X> inline T resetbit(T a, X i) { T t=1;return (a&(~(t<<i)));}

inline LL power(LL a, LL b)
{
	LL multiply=1;
	REP(i,1,b)
	{
		multiply*=a;
	}
	return multiply;
}
inline LL ABS(LL a){return (a>=0)?a:-a;}

/*end of header*/
LL n,q,even,odd,t,x,evencond,totalcond,k;
int pos[1000001];
int main()
{
    //freopen("input_file_name.in","r",stdin);
    //freopen("output_file_name.out","w",stdout);
    scanf("%lld %lld",&n,&q);
    totalcond=0;
    evencond=0;
    even=0;
    odd=0;
    REP(i,1,q)
    {
        scanf("%lld",&t);
        if(t==1)
        {
            scanf("%lld",&x);
            if(x<0)x+=n;
            totalcond+=x;
            if(x%2==1)evencond^=1LL;
        }
        else
        {
            if(evencond==0){even+=n-1;odd++;}
            else{even++;odd+=n-1;}
            evencond^=1LL;
        }
    }
    REP(i,1,n)
    {
        if(i%2==1)k=odd+totalcond+i;
        else k=even+totalcond+i;
        if(k>=n)k=k%n;
        if(k==0)k=n;
        pos[k]=i;
    }
    REP(i,1,n)printf("%d ",pos[i]);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define inf (1<<30)-1
#define INF (1LL<<62)-1
#define MOD 1000000007LL
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define PI acos(-1)
#define MEM(x,y) memset(x,y,sizeof (x))
#define debug cout<<"A"<<'\n'
#define REP(i,a,b) for (int i=(a); i<=(b); i++)
#define PER(i,a,b) for (int i=(a); i>=(b); i--)
#define REPL(i,a,b) for (LL i=(a); i<=(b); i++)
#define PERL(i,a,b) for (LL i=(a); i>=(b); i--)
#define print(x) cout<<x<<'\n'
#define dprint(a,x) cout<<setprecision(x)<<fixed<<a<<'\n'
#define itrALL(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int>PII;
typedef pair<LL,LL>PLL;
typedef set<int> SI;
typedef set<LL> SL;
typedef set<string> SS;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef map<int,int> MII;
typedef map<LL,LL> MLL;
typedef queue<int> QI;

/* Direction Array */

// int fx[]={1,-1,0,0};
// int fy[]={0,0,1,-1};
// int fx[]={0,0,1,-1,-1,1,-1,1};
// int fy[]={-1,1,0,0,1,1,-1,-1};

template <class T> inline T bigmod(T p,T e,T M)
{
    T ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}

template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}
template <class T> inline T lcm(T a,T b) {a=abs(a);b=abs(b); return (a/gcd(a,b))*b;}
template <class T, class X> inline bool getbit(T a, X i) { T t=1; return ((a&(t<<i))>0);}
template <class T, class X> inline T setbit(T a, X i) { T t=1;return (a|(t<<i)); }
template <class T, class X> inline T resetbit(T a, X i) { T t=1;return (a&(~(t<<i)));}

inline LL power(LL a, LL b)
{
	LL multiply=1;
	REP(i,1,b)
	{
		multiply*=a;
	}
	return multiply;
}
inline LL ABS(LL a){return (a>=0)?a:-a;}

/*end of header*/
LL n,q,even,odd,t,x,evencond,totalcond,k,pos[1000001];
int main()
{
    //freopen("input_file_name.in","r",stdin);
    //freopen("output_file_name.out","w",stdout);
    cin>>n>>q;
    totalcond=0;
    evencond=0;
    even=0;
    odd=0;
    REP(i,1,q)
    {
        cin>>t;
        if(t==1)
        {
            cin>>x;
            if(x<0)x+=n;
            totalcond+=x;
            if(x%2==1)evencond^=1LL;
        }
        else
        {
            if(evencond==0){even+=n-1;odd++;}
            else{even++;odd+=n-1;}
            evencond^=1LL;
        }
    }
    REP(i,1,n)
    {
        if(i%2==1)k=odd+totalcond+i;
        else k=even+totalcond+i;
        if(k>=n)k=k%n;
        if(k==0)k=n;
        pos[k]=i;
    }
    REP(i,1,n)cout<<pos[i]<<' ';
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define inf (1<<30)-1
#define INF (1LL<<62)-1
#define MOD 1000000007LL
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define PI acos(-1)
#define MEM(x,y) memset(x,y,sizeof (x))
#define debug cout<<"A"<<'\n'
#define REP(i,a,b) for (int i=(a); i<=(b); i++)
#define PER(i,a,b) for (int i=(a); i>=(b); i--)
#define REPL(i,a,b) for (LL i=(a); i<=(b); i++)
#define PERL(i,a,b) for (LL i=(a); i>=(b); i--)
#define print(x) cout<<x<<'\n'
#define dprint(a,x) cout<<setprecision(x)<<fixed<<a<<'\n'
#define itrALL(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int>PII;
typedef pair<LL,LL>PLL;
typedef set<int> SI;
typedef set<LL> SL;
typedef set<string> SS;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef map<int,int> MII;
typedef map<LL,LL> MLL;
typedef queue<int> QI;

/* Direction Array */

// int fx[]={1,-1,0,0};
// int fy[]={0,0,1,-1};
// int fx[]={0,0,1,-1,-1,1,-1,1};
// int fy[]={-1,1,0,0,1,1,-1,-1};

template <class T> inline T bigmod(T p,T e,T M)
{
    T ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}

template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}
template <class T> inline T lcm(T a,T b) {a=abs(a);b=abs(b); return (a/gcd(a,b))*b;}
template <class T, class X> inline bool getbit(T a, X i) { T t=1; return ((a&(t<<i))>0);}
template <class T, class X> inline T setbit(T a, X i) { T t=1;return (a|(t<<i)); }
template <class T, class X> inline T resetbit(T a, X i) { T t=1;return (a&(~(t<<i)));}

inline LL power(LL a, LL b)
{
	LL multiply=1;
	REP(i,1,b)
	{
		multiply*=a;
	}
	return multiply;
}
inline LL ABS(LL a){return (a>=0)?a:-a;}

/*end of header*/
LL n,q,even,odd,t,x,evencond,totalcond,k,pos[1000001];
int main()
{
    //freopen("input_file_name.in","r",stdin);
    //freopen("output_file_name.out","w",stdout);
    cin>>n>>q;
    totalcond=0;
    evencond=0;
    even=0;
    odd=0;
    REP(i,1,q)
    {
        cin>>t;
        if(t==1)
        {
            cin>>x;
            totalcond+=x;
            if(x%2==1)evencond^=1LL;
        }
        else
        {
            if(evencond==0){even--;odd++;}
            else{even++;odd--;}
            evencond^=1LL;
        }
    }
    REP(i,1,n)
    {
        if(i%2==1)k=odd+totalcond+i;
        else k=even+totalcond+i;
        if(k<0)
        {
            k+=(2000000LL*n);
            while(k<0)k+=n;
        }
        if(k>=n)k=k%n;
        if(k==0)k=n;
        pos[k]=i;
    }
    REP(i,1,n)cout<<pos[i]<<' ';
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define inf (1<<30)-1
#define INF (1LL<<62)-1
#define MOD 1000000007LL
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define PI acos(-1)
#define MEM(x,y) memset(x,y,sizeof (x))
#define debug cout<<"A"<<'\n'
#define REP(i,a,b) for (int i=(a); i<=(b); i++)
#define PER(i,a,b) for (int i=(a); i>=(b); i--)
#define REPL(i,a,b) for (LL i=(a); i<=(b); i++)
#define PERL(i,a,b) for (LL i=(a); i>=(b); i--)
#define print(x) cout<<x<<'\n'
#define dprint(a,x) cout<<setprecision(x)<<fixed<<a<<'\n'
#define itrALL(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int>PII;
typedef pair<LL,LL>PLL;
typedef set<int> SI;
typedef set<LL> SL;
typedef set<string> SS;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef map<int,int> MII;
typedef map<LL,LL> MLL;
typedef queue<int> QI;

/* Direction Array */

// int fx[]={1,-1,0,0};
// int fy[]={0,0,1,-1};
// int fx[]={0,0,1,-1,-1,1,-1,1};
// int fy[]={-1,1,0,0,1,1,-1,-1};

template <class T> inline T bigmod(T p,T e,T M)
{
    T ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}

template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}
template <class T> inline T lcm(T a,T b) {a=abs(a);b=abs(b); return (a/gcd(a,b))*b;}
template <class T, class X> inline bool getbit(T a, X i) { T t=1; return ((a&(t<<i))>0);}
template <class T, class X> inline T setbit(T a, X i) { T t=1;return (a|(t<<i)); }
template <class T, class X> inline T resetbit(T a, X i) { T t=1;return (a&(~(t<<i)));}

inline LL power(LL a, LL b)
{
	LL multiply=1;
	REP(i,1,b)
	{
		multiply*=a;
	}
	return multiply;
}
inline LL ABS(LL a){return (a>=0)?a:-a;}

/*end of header*/
LL n,q,even,odd,t,x,evencond,totalcond,k,pos[1000001];
int main()
{
    //freopen("input_file_name.in","r",stdin);
    //freopen("output_file_name.out","w",stdout);
    cin>>n>>q;
    totalcond=0;
    evencond=0;
    even=0;
    odd=0;
    REP(i,1,q)
    {
        cin>>t;
        if(t==1)
        {
            cin>>x;
            totalcond+=x;
            if(x%2==1)evencond^=1LL;
        }
        else
        {
            if(evencond==0){even--;odd++;}
            else{even++;odd--;}
            evencond^=1LL;
        }
    }
    REP(i,1,n)
    {
        if(i%2==1)k=odd+totalcond+i;
        else k=even+totalcond+i;
        if(k<0)
        {
            LL p=(-1)*k;
            p/=n;
            k+=p*n;
            while(k<0)k+=n;
        }
        if(k>=n)k=k%n;
        if(k==0)k=n;
        pos[k]=i;
    }
    REP(i,1,n)cout<<pos[i]<<' ';
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, q;
	cin >> n;
	int rotation = 0;
	int shift = 0,type;
	cin >> q;
	int state = 0, oddshift=0, evenshift = 0;
	while(q--)
	{
		scanf("%d",&type);
		if(type==2)
			{
				rotation++;
				if(oddshift%2==0)
					oddshift+=1;
				else
					oddshift-=1;
				if(evenshift%2==0)
					evenshift-=1;
				else
					evenshift+=1;

			}
		else
		{
			scanf("%d", &type);
			oddshift+=type;
			evenshift+=type;
		}
	}
	int ans[100001],counti=0,i;
	counti=0;
	i = 0;
	while(counti<n)
	{

		ans[1+(counti+oddshift)%n]=counti +1,
		counti+=2;
	}
	//cout << oddshift << endl;
	counti = 0;
	while(counti<n)
	{
		ans[(1+(counti+evenshift))%n + 1] = counti +2;
		counti+=2;
	}
	printf("%d",ans[1]);
	for(i=2;i<=n;i++)
		printf(" %d",ans[i]);
	printf("\n");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, q;
	cin >> n;
	int rotation = 0;
	int shift = 0,type;
	cin >> q;
	int state = 0, oddshift=0, evenshift = 0;
	while(q--)
	{
		scanf("%d",&type);
		if(type==2)
			{
				rotation++;
				if(oddshift%2==0)
					oddshift+=1;
				else
					oddshift-=1;
				if(evenshift%2==0)
					evenshift-=1;
				else
					evenshift+=1;

			}
		else
		{
			scanf("%d", &type);
			oddshift+=type;
			evenshift+=type;
		}
	}
	int ans[100001],counti=0,i;
	counti=0;
	i = 0;
	oddshift+=n;
	evenshift+=n;
	while(counti<n)
	{

		ans[1+(counti+oddshift)%n]=counti +1,
		counti+=2;
	}
	//cout << oddshift << endl;
	counti = 0;
	while(counti<n)
	{
		ans[(1+(counti+evenshift))%n + 1] = counti +2;
		counti+=2;
	}
	printf("%d",ans[1]);
	for(i=2;i<=n;i++)
		printf(" %d",ans[i]);
	printf("\n");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, q;
	cin >> n;
	int rotation = 0;
	int shift = 0,type;
	cin >> q;
	int state = 0, oddshift=0, evenshift = 0;
	while(q--)
	{
		scanf("%d",&type);
		if(type==2)
			{
				rotation++;
				if(oddshift%2==0)
					oddshift+=1;
				else
					oddshift-=1;
				if(evenshift%2==0)
					evenshift-=1;
				else
					evenshift+=1;

			}
		else
		{
			scanf("%d", &type);
			oddshift+=type;
			evenshift+=type;
		}
	}
	int ans[100001],counti=0,i;
	counti=0;
	i = 0;
	while(oddshift<0)
	oddshift+=n;
	while(evenshift<0)
	evenshift+=n;
	while(counti<n)
	{

		ans[1+(counti+oddshift)%n]=counti +1,
		counti+=2;
	}
	//cout << oddshift << endl;
	counti = 0;
	while(counti<n)
	{
		ans[(1+(counti+evenshift))%n + 1] = counti +2;
		counti+=2;
	}
	printf("%d",ans[1]);
	for(i=2;i<=n;i++)
		printf(" %d",ans[i]);
	printf("\n");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n, q;
	cin >> n;
	long long int rotation = 0;
	long long int shift = 0,type;
	cin >> q;
	long long int state = 0, oddshift=0, evenshift = 0;
	while(q--)
	{
		scanf("%lld",&type);
		if(type==2)
			{
				rotation++;
				if(oddshift%2==0)
					oddshift+=1;
				else
					oddshift-=1;
				if(evenshift%2==0)
					evenshift-=1;
				else
					evenshift+=1;

			}
		else
		{
			scanf("%lld", &type);
			oddshift+=type;
			evenshift+=type;
		}
	}
	long long int ans[1000001],counti=0,i;
	counti=0;
	i = 0;
	while(oddshift<0)
	oddshift+=n;
	while(evenshift<0)
	evenshift+=n;
	while(counti<n)
	{

		ans[1+(counti+oddshift)%n]=counti +1,
		counti+=2;
	}
	//cout << oddshift << endl;
	counti = 0;
	while(counti<n)
	{
		ans[(1+(counti+evenshift))%n + 1] = counti +2;
		counti+=2;
	}
	printf("%lld",ans[1]);
	for(i=2;i<=n;i++)
		printf(" %lld",ans[i]);
	printf("\n");
	return 0;
}


#include<bits/stdc++.h>

#define MOD 1000000007
#define MAX 1000005
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d ",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>

using namespace std;

int final[MAX];

int main(){
	int n,q;
	sd(n);sd(q);

	int sm=0,p=0,flag=0,par=0,e=0,o=0;

	while(q--){
		int t;
		sd(t);

		if(t==1){
			int x;
			sd(x);
			sm+=n+x;
			sm%=n;
			if((int(abs(x)))%2!=0) par++,swap(e,o);
		}
		else if(t==2){
			par++;
			if(par%2!=0) e++,o--;
			else e--,o++;
		}
	}

	for(int i=1;i<=n;i++){
		int id=(i-1+sm)%n;
		if(id%2==0) id=(id+e+n)%n+1;
		else id=(id+o+n)%n+1;

		final[id]=i;
	}

	for(int i=1;i<=n;i++) pd(final[i]);
}


#include<bits/stdc++.h>

#define MOD 1000000007
#define MAX 1000005
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d ",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>

using namespace std;

int final[MAX];

int main(){
	int n,q;
	sd(n);sd(q);

	int sm=0,e=0,o=0,p=0;

	while(q--){
		int t;
		sd(t);

		if(t==1){
			int x;
			sd(x);
			sm+=n+x;
			sm%=n;
			if((int(abs(x)))%2!=0) p=!p,swap(e,o);
		}
		else if(t==2){
			if(p) e=(e-1+n)%n,o=(o+1)%n,p=!p;
			else e=(e+1)%n,o=(o-1+n)%n,p=!p;
		}
	}

	for(int i=1;i<=n;i++){
		int id=(i-1+sm)%n;
		if(id%2==0) id=(id+e+n)%n+1;
		else id=(id+o+n)%n+1;

		final[id]=i;
	}

	for(int i=1;i<=n;i++) pd(final[i]);
}


#include<bits/stdc++.h>

#define MOD 1000000007
#define MAX 1000005
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d ",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>

using namespace std;

int final[MAX];

int main(){
	int n,q;
	sd(n);sd(q);

	int sm=0,e=0,o=0;

	while(q--){
		int t;
		sd(t);

		if(t==1){
			int x;
			sd(x);
			sm+=n+x;
			sm%=n;
			if((int(abs(x)))%2!=0) swap(e,o);
		}
		else if(t==2){
			e++,o--;
		}
	}

	for(int i=1;i<=n;i++){
		int id=(i-1+sm)%n;
		if(id%2==0) id=(id+e+n)%n+1;
		else id=(id+o+n)%n+1;

		final[id]=i;
	}

	for(int i=1;i<=n;i++) pd(final[i]);
}


#include<bits/stdc++.h>

#define MOD 1000000007
#define MAX 1000005
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d ",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>

using namespace std;

int final[MAX];

int main(){
	int n,q;
	sd(n);sd(q);

	int sm=0,p=0,flag=0,par=0,e=0,o=0;

	while(q--){
		int t;
		sd(t);

		if(t==1){
			int x;
			sd(x);
			sm+=n+x;
			sm%=n;
			if((int(abs(x)))%2!=0) par++,swap(e,o);
		}
		else if(t==2){
			e++,o--;
			par++;
		}
	}

	for(int i=1;i<=n;i++){
		int id=(i-1+sm)%n;
		if(id%2==0) id=(id+e+n)%n+1;
		else id=(id+o+n)%n+1;

		final[id]=i;
	}

	for(int i=1;i<=n;i++) pd(final[i]);
}


#include<bits/stdc++.h>

#define MOD 1000000007
#define MAX 1000005
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d ",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>

using namespace std;

int final[MAX];

int main(){
	int n,q;
	sd(n);sd(q);

	int sm=0,e=0,o=0,p=0,last=0,xx=0;

	while(q--){
		int t;
		sd(t);

		if(t==1){
			int x;
			sd(x);
			sm+=n+x;
			sm%=n;
			if((int(abs(x)))%2!=0) swap(e,o);
		}
		else if(t==2){
			if(!xx) {e++;o--; e+=n;o+=n; e%=n; o%=n; xx=1;}
			else {e--;o++; e+=n;o+=n; e%=n; o%=n; xx=0;}
		}
	}

	for(int i=1;i<=n;i++){
		int id=(i-1+sm)%n;
		if(id%2==0) id=(id+e+n)%n+1;
		else id=(id+o+n)%n+1;

		final[id]=i;
	}

	for(int i=1;i<=n;i++) pd(final[i]);
}


#include<bits/stdc++.h>

#define MOD 1000000007
#define MAX 1000005
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d ",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>

using namespace std;

int final[MAX];

int main(){
	int n,q;
	sd(n);sd(q);

	int sm=0,e=0,o=0,p=0,last=0;

	while(q--){
		int t;
		sd(t);

		if(t==1){
			int x;
			sd(x);
			sm+=n+x;
			sm%=n;
			if((int(abs(x)))%2!=0) p=!p,last=1;
		}
		else if(t==2){
			if(!p) {e++;o--; e+=n;o+=n; e%=n; o%=n; p=!p;last=0;}
			else {e--;o++; e+=n;o+=n; e%=n; o%=n; p=!p;last=0;}
		}
	}

	if(last) swap(e,o);

	for(int i=1;i<=n;i++){
		int id=(i-1+sm)%n;
		if(id%2==0) id=(id+e+n)%n+1;
		else id=(id+o+n)%n+1;

		final[id]=i;
	}

	for(int i=1;i<=n;i++) pd(final[i]);
}


#include<bits/stdc++.h>

#define MOD 1000000007
#define MAX 1000005
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d ",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>

using namespace std;

int final[MAX];

int main(){
	int n,q;
	sd(n);sd(q);

	int sm=0,e=0,o=0,p=0;

	while(q--){
		int t;
		sd(t);

		if(t==1){
			int x;
			sd(x);
			sm+=n+x;
			sm%=n;
			if((int(abs(x)))%2!=0) p=!p,swap(e,o);
		}
		else if(t==2){
			if(p) e--,o++,p=!p;
			else e++,o--,p=!p;
		}
	}

	for(int i=1;i<=n;i++){
		int id=(i-1+sm)%n;
		if(id%2==0) id=(id+e+n)%n+1;
		else id=(id+o+n)%n+1;

		final[id]=i;
	}

	for(int i=1;i<=n;i++) pd(final[i]);
}


#include<bits/stdc++.h>
#define ll long long
#define Mod 1000000007
#define int long long

using namespace std;

typedef pair< ll,ll> pii;
typedef pair<ll,pii> piii;
typedef vector<pii> vii;
ll a[2000021],val[2000021],t[2000021];
vector<ll> v;
main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll i,j,k,n,q,ck=0;
    cin>>n>>q;
    for(i=0;i<q;i++){
        cin>>t[i];
        if(t[i]==1)
            cin>>val[i];
    }
//    odd
    ll odd=0,ul=0,ul2=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            ll ku=0;
            ul+=val[i];
            ul2+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2==1&&odd==0)
                odd=1;
            else
                if(ku%2==1&&odd==1)
                    {odd=0;}

        }
        else
            if(odd==1)
               { ul2+=1;ul-=1,odd=0;}
            else
                {ul+=1;odd=1;ul2-=1;}
    }
    for(i=1;i<=n;i++){
        if(i%2)
            ck=ul;
        else
            ck=ul2;
        ll rd=i+ck;
        if(rd<0)
        {
            rd=-rd;
            rd%=n;
            rd=n-rd;
            a[rd]=i;
        }
        else{
        rd%=n;
        if(rd==0)
            a[n]=i;
        else
            a[rd]=i;
        }
    }
//    cout<<ul<<" "<<ul2;
    for(i=1;i<=n;i++)
        cout<<a[i]<<" ";
    cout<<'\n';
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define Mod 1000000007
#define F first
#define S second
#define maxm(a,b) (a>b)?a:b
#define minm(a,b) (a<b)?a:b

using namespace std;

typedef pair< ll,ll> pii;
typedef pair<ll,pii> piii;
typedef vector<pii> vii;
ll a[2000021],val[2000021],t[2000021];
vector<ll> v;
int main()
{
    ll i,j,k,n,q,ck=0;
    cin>>n>>q;
    for(i=0;i<q;i++){
        cin>>t[i];
        if(t[i]==1)
            cin>>val[i];
    }
//    odd
    ll odd=0,ul=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            int ku=0;
            ul+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2&&odd==0)
                odd=1;
            else
                if(ku%2&&odd==1)
                    odd=0;

        }
        else
            if(odd==1)
                ul-=1,odd=0;
            else
                {ul+=1;odd=1;}
    }
//    even
    ll even=0,ul2=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            int ku=0;
            ul2+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2&&even==0)
                even=1;
            else
                if(ku%2&&even==1)
                    even=0;
        }
        else
            if(even==0)
                ul2-=1,even=1;
            else
                {ul2+=1; even=0;}
    }
    for(i=1;i<=n;i++){
        if(i%2)
            ck=ul;
        else
            ck=ul2;
        ll rd=i+ck;
        if(rd<0)
            rd=-rd;
        if(rd==0)
            a[i]=i;
        else{
        rd%=n;
        if(rd==0)
            a[n]=i;
        else
            a[rd]=i;
        }
    }
//    cout<<ul<<" "<<ul2;
    for(i=1;i<=n;i++)
        cout<<a[i]<<" ";
    cout<<'\n';
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define Mod 1000000007
#define int long long

using namespace std;

typedef pair< ll,ll> pii;
typedef pair<ll,pii> piii;
typedef vector<pii> vii;
ll a[2000021],val[2000021],t[2000021];
vector<ll> v;
main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll i,j,k,n,q,ck=0;
    cin>>n>>q;
//    odd
    ll odd=0,ul=0,ul2=0;
    for(i=0;i<q;i++){
        cin>>t[i];
        if(t[i]==1)
            cin>>val[i];
        if(t[i]==1){
            ll ku=0;
            ul+=val[i];
            ul2+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2==1&&odd==0)
                odd=1;
            else
                if(ku%2==1&&odd==1)
                    {odd=0;}

        }
        else
            if(odd==1)
               { ul2+=1;ul-=1,odd=0;}
            else
                {ul+=1;odd=1;ul2-=1;}
    }
    for(i=1;i<=n;i++){
        if(i%2)
            ck=ul;
        else
            ck=ul2;
        ll rd=i+ck;
        if(rd<0)
        {
            rd=-rd;
            rd%=n;
            rd=n-rd;
            a[rd]=i;
        }
        else{
        rd%=n;
        if(rd==0)
            a[n]=i;
        else
            a[rd]=i;
        }
    }
//    cout<<ul<<" "<<ul2;
    for(i=1;i<=n;i++)
        cout<<a[i]<<" ";
    cout<<'\n';
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define Mod 1000000007
#define int long long

using namespace std;

typedef pair< ll,ll> pii;
typedef pair<ll,pii> piii;
typedef vector<pii> vii;
ll a[2000021],val[2000021],t[2000021];
vector<ll> v;
main()
{
    ll i,j,k,n,q,ck=0;
    cin>>n>>q;
    for(i=0;i<q;i++){
        cin>>t[i];
        if(t[i]==1)
            cin>>val[i];
    }
//    odd
    ll odd=0,ul=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            ll ku=0;
            ul+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2==1&&odd==0&&ku!=0)
                odd=1;
            else
                if(ku%2==1&&odd==1&&ku!=0)
                    odd=0;

        }
        else
            if(odd==1)
                ul-=1,odd=0;
            else
                {ul+=1;odd=1;}
    }
//    even
    ll even=0,ul2=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            ll ku=0;
            ul2+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2==1&&even==0&&ku!=0)
                even=1;
            else
                if(ku%2==1&&even==1&&ku!=0)
                    even=0;
        }
        else
            if(even==0)
                ul2-=1,even=1;
            else
                {ul2+=1; even=0;}
    }
    for(i=1;i<=n;i++){
        if(i%2)
            ck=ul;
        else
            ck=ul2;
        ll rd=i+ck;
        if(rd<0)
        {
            rd=-rd;
            rd%=n;
            rd=n-rd;
            a[rd]=i;
        }
        else{
        rd%=n;
        if(rd==0)
            a[n]=i;
        else
            a[rd]=i;
        }
    }
//    cout<<ul<<" "<<ul2;
    for(i=1;i<=n;i++)
        cout<<a[i]<<" ";
    cout<<'\n';
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define Mod 1000000007

using namespace std;

int a[2000021],t,val;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll i,j,k,n,q,ck=0;
    cin>>n>>q;
    ll odd=0,ul=0,ul2=0;
    for(i=0;i<q;i++){
        cin>>t;
        if(t==1){
            cin>>val;
            ll ku=0;
            ul+=val;
            ul2+=val;
            if(val<0)
                ku=-val;
            else
                ku=val;
            if((ku&1)&&odd==0)
                odd=1;
            else
                if((ku&1)&&odd==1)
                    odd=0;

        }
        else{
            if(odd==1)
               { ul2+=1;ul-=1;odd=0;}
            else
                {ul+=1;odd=1;ul2-=1;}
        }
    }
    for(i=1;i<=n;i++){
        if(i%2)
            ck=ul;
        else
            ck=ul2;
        ll rd=i+ck;
        if(rd<0)
        {
            rd=-rd;
            rd%=n;
            rd=n-rd;
            a[rd]=i;
        }
        else{
        rd%=n;
        if(rd==0)
            a[n]=i;
        else
            a[rd]=i;
        }
    }
    for(i=1;i<=n;i++)
        cout<<a[i]<<" ";
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define Mod 1000000007
#define F first
#define S second
#define maxm(a,b) (a>b)?a:b
#define minm(a,b) (a<b)?a:b

using namespace std;

typedef pair< ll,ll> pii;
typedef pair<ll,pii> piii;
typedef vector<pii> vii;
ll a[2000021],val[2000021],t[2000021];
vector<ll> v;
int main()
{
    ll i,j,k,n,q,ck=0;
    cin>>n>>q;
    for(i=0;i<q;i++){
        cin>>t[i];
        if(t[i]==1)
            cin>>val[i];
    }
//    odd
    ll odd=0,ul=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            int ku=0;
            ul+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2&&odd==0)
                odd=1;
            else
                if(ku%2&&odd==1)
                    odd=0;

        }
        else
            if(odd==1)
                ul-=1,odd=0;
            else
                {ul+=1;odd=1;}
    }
//    even
    ll even=0,ul2=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            int ku=0;
            ul2+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2&&even==0)
                even=1;
            else
                if(ku%2&&even==1)
                    even=0;
        }
        else
            if(even==0)
                ul2-=1,even=1;
            else
                {ul2+=1; even=0;}
    }
    for(i=1;i<=n;i++){
        if(i%2)
            ck=ul;
        else
            ck=ul2;
        int rd=i+ck;
        if(rd<0)
            rd=-rd;
        if(rd==0)
            a[i]=i;
        else{
        rd%=n;
        if(rd==0)
            a[n]=i;
        else
            a[rd]=i;
        }
    }
//    cout<<ul<<" "<<ul2;
    for(i=1;i<=n;i++)
        cout<<a[i]<<" ";
    cout<<'\n';
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define Mod 1000000007
#define int long long

using namespace std;

typedef pair< ll,ll> pii;
typedef pair<ll,pii> piii;
typedef vector<pii> vii;
ll a[2000021],val[2000021],t[2000021];
vector<ll> v;
main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll i,j,k,n,q,ck=0;
    cin>>n>>q;
    for(i=0;i<q;i++){
        cin>>t[i];
        if(t[i]==1)
            cin>>val[i];
    }
//    odd
    ll odd=0,ul=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            ll ku=0;
            ul+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2==1&&odd==0&&ku!=0)
                odd=1;
            else
                if(ku%2==1&&odd==1&&ku!=0)
                    odd=0;

        }
        else
            if(odd==1)
                ul-=1,odd=0;
            else
                {ul+=1;odd=1;}
    }
//    even
    ll even=0,ul2=0;
    for(i=0;i<q;i++){
        if(t[i]==1){
            ll ku=0;
            ul2+=val[i];
            if(val[i]<0)
                ku=-val[i];
            else
                ku=val[i];
            if(ku%2==1&&even==0&&ku!=0)
                even=1;
            else
                if(ku%2==1&&even==1&&ku!=0)
                    even=0;
        }
        else
            if(even==0)
                ul2-=1,even=1;
            else
                {ul2+=1; even=0;}
    }
    for(i=1;i<=n;i++){
        if(i%2)
            ck=ul;
        else
            ck=ul2;
        ll rd=i+ck;
        if(rd<0)
        {
            rd=-rd;
            rd%=n;
            rd=n-rd;
            a[rd]=i;
        }
        else{
        rd%=n;
        if(rd==0)
            a[n]=i;
        else
            a[rd]=i;
        }
    }
//    cout<<ul<<" "<<ul2;
    for(i=1;i<=n;i++)
        cout<<a[i]<<" ";
    cout<<'\n';
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define Mod 1000000007

using namespace std;

int a[2000021],t,val;
int main()
{
    ll i,j,k,n,q,ck=0;
    scanf("%I64d%I64d",&n,&q);
    ll odd=0,ul=0,ul2=0;
    for(i=0;i<q;i++){
        scanf("%d",&t);
        if(t==1){
            scanf("%d",&val);
            ll ku=0;
            ul+=val;
            ul2+=val;
            if(val<0)
                ku=-val;
            else
                ku=val;
            if((ku&1)&&odd==0)
                odd=1;
            else
                if((ku&1)&&odd==1)
                    odd=0;

        }
        else{
            if(odd==1)
               { ul2+=1;ul-=1;odd=0;}
            else
                {ul+=1;odd=1;ul2-=1;}
        }
    }
    for(i=1;i<=n;i++){
        if(i%2)
            ck=ul;
        else
            ck=ul2;
        ll rd=i+ck;
        if(rd<0)
        {
            rd=-rd;
            rd%=n;
            rd=n-rd;
            a[rd]=i;
        }
        else{
        rd%=n;
        if(rd==0)
            a[n]=i;
        else
            a[rd]=i;
        }
    }
    for(i=1;i<=n;i++)
        printf("%d ",a[i]);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define rep(i,a) for(ll i=0;i<a;++i)
#define repp(i,a,b) for(ll i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define    foreach( gg,itit )	for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define	mp make_pair
#define	pb push_back
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);

ll an[1000005];
int main()
{
    fastScan;
    ll n,q,od=0,ev=0,x,a,of=0,ef=0;
    scanf("%lld%lld",&n,&q);
    rep(i,q){
        scanf("%lld",&x);
        if(x==1){
            scanf("%lld",&a);
            od+=a;
            ev+=a;
            if((abs(a)%2)==1){
                of=1-of;
                ef=1-ef;
            }
        }
        else{
            if(of==0){
                od++;
                of=1;
            }
            else{
                od--;
                of=0;
            }
            if(ef==0){
                ev--;
                ef=1;
            }
            else{
                ev++;
                ef=0;
            }
        }
    }
    if(od<0){
        ll qu=(abs(od))/n;
        od+=((qu+3)*n);
    }
    if(ev<0){
        ll qu=(abs(ev))/n;
        ev+=((qu+3)*n);
    }
    ll tmp;
    repp(i,1,n+1){
        if(i%2==1){
            tmp=(i+od)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
        else{
            tmp=(i+ev)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
    }
    repp(i,1,n+1){
        assert(an[i]!=0);
        printf("%lld ",an[i]);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define rep(i,a) for(ll i=0;i<a;++i)
#define repp(i,a,b) for(ll i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define    foreach( gg,itit )	for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define	mp make_pair
#define	pb push_back
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);

ll an[1000005];
int main()
{
    fastScan;
    ll n,q,od=0,ev=0,x,a,of=0,ef=0;
    cin>>n>>q;
    rep(i,q){
        cin>>x;
        if(x==1){
            cin>>a;
            od+=a;
            ev+=a;
            if((abs(a)%2)==1){
                of=1-of;
                ef=1-ef;
            }
        }
        else{
            if(of==0){
                od++;
                of=1;
            }
            else{
                od--;
                of=0;
            }
            if(ef==0){
                ev--;
                ef=1;
            }
            else{
                ev++;
                ef=0;
            }
        }
    }
    while(od<0)od+=n;
    while(ev<0)ev+=n;
    ll tmp;
    repp(i,1,n+1){
        if(i%2==1){
            tmp=(i+od)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
        else{
            tmp=(i+ev)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
    }
    repp(i,1,n+1){
        assert(an[i]!=0);
        cout<<an[i]<<" ";
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define rep(i,a) for(ll i=0;i<a;++i)
#define repp(i,a,b) for(ll i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define    foreach( gg,itit )	for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define	mp make_pair
#define	pb push_back
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);

ll an[1000005];
int main()
{
    fastScan;
    ll n,q,od=0,ev=0,x,a,of=0,ef=0;
    cin>>n>>q;
    rep(i,q){
        cin>>x;
        if(x==1){
            cin>>a;
            od+=a;
            ev+=a;
            if((abs(a)%2)==1){
                of=1-of;
                ef=1-ef;
            }
        }
        else{
            if(of==0){
                od++;
                of=1;
            }
            else{
                od--;
                of=0;
            }
            if(ef==0){
                ev--;
                ef=1;
            }
            else{
                ev++;
                ef=0;
            }
        }
    }
    if(od<0){
        ll qu=(abs(od))/n;
        od+=((qu+3)*n);
    }
    if(ev<0){
        ll qu=(abs(ev))/n;
        od+=((qu+3)*n);
    }
    ll tmp;
    repp(i,1,n+1){
        if(i%2==1){
            tmp=(i+od)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
        else{
            tmp=(i+ev)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
    }
    repp(i,1,n+1){
        assert(an[i]!=0);
        cout<<an[i]<<" ";
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define rep(i,a) for(ll i=0;i<a;++i)
#define repp(i,a,b) for(ll i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define    foreach( gg,itit )	for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define	mp make_pair
#define	pb push_back
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);

ll an[1000005];
int main()
{
    fastScan;
    ll n,q,od=0,ev=0,x,a,of=0,ef=0;
    cin>>n>>q;
    rep(i,q){
        cin>>x;
        if(x==1){
            cin>>a;
            od+=a;
            ev+=a;
            if((abs(a)%2)==1){
                of=1-of;
                ef=1-ef;
            }
        }
        else{
            if(of==0){
                od++;
                of=1;
            }
            else{
                od--;
                of=0;
            }
            if(ef==0){
                ev--;
                ef=1;
            }
            else{
                ev++;
                ef=0;
            }
        }
    }
    if(od<0){
        ll qu=(abs(od))/n;
        od+=((qu+3)*n);
    }
    if(ev<0){
        ll qu=(abs(ev))/n;
        ev+=((qu+3)*n);
    }
    ll tmp;
    repp(i,1,n+1){
        if(i%2==1){
            tmp=(i+od)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
        else{
            tmp=(i+ev)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
    }
    repp(i,1,n+1){
        assert(an[i]!=0);
        cout<<an[i]<<" ";
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define rep(i,a) for(ll i=0;i<a;++i)
#define repp(i,a,b) for(ll i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define    foreach( gg,itit )	for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define	mp make_pair
#define	pb push_back
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);

ll an[1000005];
int main()
{
    fastScan;
    ll n,q,od=0,ev=0,x,a,of=0,ef=0;
    cin>>n>>q;
    rep(i,q){
        cin>>x;
        if(x==1){
            cin>>a;
            od+=a;
            ev+=a;
            if(a%2==1){
                of=1-of;
                ef=1-ef;
            }
        }
        else{
            if(of==0){
                od++;
                of=1;
            }
            else{
                od--;
                of=0;
            }
            if(ef==0){
                ev--;
                ef=1;
            }
            else{
                ev++;
                ef=0;
            }
        }
    }
    while(od<0)od+=n;
    while(ev<0)ev+=n;
    ll tmp;
    repp(i,1,n+1){
        if(i%2==1){
            tmp=(i+od)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
        else{
            tmp=(i+ev)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
    }
    repp(i,1,n+1){
        assert(an[i]!=0);
        cout<<an[i]<<" ";
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define rep(i,a) for(ll i=0;i<a;++i)
#define repp(i,a,b) for(ll i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define    foreach( gg,itit )	for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define	mp make_pair
#define	pb push_back
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);

ll an[1000005];
int main()
{
    fastScan;
    ll n,q,od=0,ev=0,x,a,of=0,ef=0,cnt=0;
    cin>>n>>q;
    rep(i,q){
        cin>>x;
        if(x==1){
            cin>>a;
            od+=a;
            ev+=a;
        }
        else{
            /*if(of==0){
                od++;
                of=1;
            }
            else{
                od--;
                of=0;
            }
            if(ef==0){
                ev--;
                ef=1;
            }
            else{
                ev++;
                ef=0;
            }*/
            cnt++;
        }
    }
    if(cnt%2==1){
        od++;
        ev--;
    }
    while(od<0)od+=n;
    while(ev<0)ev+=n;
    ll tmp;
    repp(i,1,n+1){
        if(i%2==1){
            tmp=(i+od)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
        else{
            tmp=(i+ev)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
    }
    repp(i,1,n+1){
        assert(an[i]!=0);
        cout<<an[i]<<" ";
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define rep(i,a) for(ll i=0;i<a;++i)
#define repp(i,a,b) for(ll i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define    foreach( gg,itit )	for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define	mp make_pair
#define	pb push_back
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);

ll an[1000005];
int main()
{
    fastScan;
    ll n,q,od=0,ev=0,x,a,of=0,ef=0;
    cin>>n>>q;
    rep(i,q){
        cin>>x;
        if(x==1){
            cin>>a;
            od+=a;
            ev+=a;
        }
        else{
            if(of==0){
                od++;
                of=1;
            }
            else{
                od--;
                of=0;
            }
            if(ef==0){
                ev--;
                ef=1;
            }
            else{
                ev++;
                ef=0;
            }
        }
    }
    while(od<0)od+=n;
    while(ev<0)ev+=n;
    ll tmp;
    repp(i,1,n+1){
        if(i%2==1){
            tmp=(i+od)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
        else{
            tmp=(i+ev)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
    }
    repp(i,1,n+1)cout<<an[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define rep(i,a) for(ll i=0;i<a;++i)
#define repp(i,a,b) for(ll i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define    foreach( gg,itit )	for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define	mp make_pair
#define	pb push_back
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);

ll an[1000005];
int main()
{
    fastScan;
    ll n,q,od=0,ev=0,x,a,of=0,ef=0;
    scanf("%lld%lld",&n,&q);
    rep(i,q){
        scanf("%lld",&x);
        if(x==1){
            scanf("%lld",&a);
            od+=a;
            ev+=a;
            if((abs(a)%2)==1){
                of=1-of;
                ef=1-ef;
            }
        }
        else{
            if(of==0){
                od++;
                of=1;
            }
            else{
                od--;
                of=0;
            }
            if(ef==0){
                ev--;
                ef=1;
            }
            else{
                ev++;
                ef=0;
            }
        }
    }
    if(od<0){
        ll qu=(abs(od))/n;
        od+=((qu+3)*n);
    }
    if(ev<0){
        ll qu=(abs(ev))/n;
        od+=((qu+3)*n);
    }
    ll tmp;
    repp(i,1,n+1){
        if(i%2==1){
            tmp=(i+od)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
        else{
            tmp=(i+ev)%n;
            if(tmp==0)tmp=n;
            an[tmp]=i;
        }
    }
    repp(i,1,n+1){
        assert(an[i]!=0);
        printf("%lld ",an[i]);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int n, q;

int pos1 =  1;
int pos2 = 2;

int getpos(int cur, int ahd) {
	// cout <<cur <<"**"<<ahd<<endl;
	if (ahd > 0) {
		cur = cur + 2 *  ahd;
		if (cur > n)  cur = cur - n;
	}
	if (ahd <  0) {
		cur = cur -  2 *  ahd;
		if (cur <= 0)  cur = cur + n;
	}
	return cur;
}
int main ()
{
	cin >> n >> q;
	int hlf = n/2;
	for (int i = 1; i <= q; i++) {
		int tp;
		cin >> tp;
		if (tp == 2) {
			swap(pos1, pos2);
		}
		else {
			int x;
			cin >> x;
			if (x > 0) {
				if (x % 2 == 0) {

					pos1 = getpos(pos1, (n - x)/2);
					pos2 = getpos(pos2, (n-x)/2);
				}
				else {
					// cout <<n<<"###"<<x<<endl;
					int  hk = getpos(pos2, (n - x -1)/2);
					int pk  = getpos(pos1, (n - x + 1)/2);
					pos1 = hk;
					pos2 = pk;
				}
				// cout <<pos1 <<" "<<pos2<<endl;
				// return 0;
			}
			else {
				x = -x;
				if (x % 2 == 0) {
					pos1 = getpos(pos1, x/2);
					pos2 = getpos(pos2, x/2);
				}
				else {
					int  hk = getpos(pos2, (x +1)/2);
					int pk  = getpos(pos1, (x -1)/2);
					pos1 = hk;
					pos2 = pk;
				}
			}
		}
	}
	for (int i = 1; i <= n/2; i++) {
		cout <<pos1 <<" "<<pos2<<" ";
		pos1 += 2;
		pos2 += 2;
		if (pos1 > n) pos1 -= n;
		if (pos2 > n) pos2 -= n;
	}
	return 0;
}