#include<fstream>
#include<algorithm>
#include <iostream>
#include<numeric>
#include<utility>
#include<functional>
#include<stdio.h>
#include<assert.h>
#include<memory.h>
#include<bitset>
#include <stack>
#include <queue>
#include <vector>
#include <unordered_map>
#include <iterator>
#include <math.h>
#include<cstring>
#include <cmath>
#include <sstream>
#include<cstring>
#include<cstdlib>
#include <set>
#include <cstdio>
#include<map>
#include <cmath>
#include <map>
#define fst first
#define snd second
#define pb push_back
#define fast std::ios_base::sync_with_stdio(false);
#define LL long long
#define endl "\n"
#define lp(i,n) for(int i=0;i<(int)n;i++)
#define all(v)              ((v).begin()), ((v).end())
#define sz(v)               ((int)((v).size()))
#define clr(v, d)           memset(v, d, sizeof(v))
#define rep(i, v)       for(int i=0;i<sz(v);i++)
#define neg(v)       memset(v,-1,sizeof(v))
#define emp(v)       memset(v,0,sizeof(v))
#define lp1(i,n)    for(int i=1;i<=(int)n;i++)
using namespace std;
#define FOR(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define readfile freopen("input.txt","r",stdin);
#define writefile ("output.txt","w",stdout);
#define PI 3.1415926536
typedef pair<LL,LL> pLL;
typedef pair<int,int> ii;
LL gcd(LL a, LL b) { if(b==0) return a;   return gcd(b,a%b);  }
LL lcm (LL a, LL b) {   return a*(b/(gcd(a,b)));  }
inline int toInt(string s){int v; istringstream sin(s);sin>>v;return v;}
inline LL toLL(string s){LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}
using namespace std;
map<int,int> v;

long long elmod(long long am, long long n)
{
	if(am >= 0) return am % n;
	else ((am+n)%n+n)%n;
	return am;
}
int main()
{
	fast

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

	long long odd = 1;
	long long even = 0;
	int t;
	long long am;

	while(q--)
	{
		cin >> t;

		if(t == 1)
		{
			cin >> am;
			odd += am;
			even += am;
		}
		else
		{

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

	for(int i = 0 ; i < n; i++)
	{
		long long kolo = i ;
		if((i % 2 == 1)) kolo += even;
		else kolo += odd;
		v[elmod(kolo,n)] = i + 1 ;
	}

	for(int i = 0 ; i < n ; i++) cout << v[i]<< " ";

}


#include <cstdio>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main()
{
    //ios_base::sync_with_stdio(false);

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

    int d[2] = {0, 1}, type, x;
    rep(i, q)
    {
	scanf("%d", &type);
	switch(type)
	{
	case 1:
	    scanf("%d", &x);
	    d[0] += x;
	    d[1] += x;
	    break;
	case 2:
	    x = (d[0] & 1 ? -1 : 1);
	    d[0] += x;
	    d[1] -= x;
	    break;
	}
    }

    d[0] = (d[0] % n + n) % n;
    d[1] = (d[1] % n + n) % n;

    bool b = d[1] & 1;
    int boy[2] = {};

    rep(i, 2)
    {
	b = !b;
	boy[i] = (n + i - d[b] + b) % n + 1;
    }

    for(int i = 0, topi = n >> 1; i < topi; ++i)
    {
	printf("%d %d ", boy[0], boy[1]);
	rep(i, 2)
	{
	    boy[i] = (boy[i] + 1) % n + 1;
	}
    }

    return 0;
}


#include <cstdio>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

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

    long long int d[2] = {0LL, 1LL} x;
    int type;
    rep(i, q)
    {
	scanf("%d", &type);
	switch(type)
	{
	case 1:
	    scanf("%I64d", &x);
	    rep(i, 2)
	    {
		d[i] += x;
		d[i] %= n;
	    }
	    break;
	case 2:
	    x = (d[0] & 1 ? -1 : 1);
	    d[0] += x;
	    d[1] -= x;
	    break;
	}
    }

    d[0] = (d[0] % n + n) % n;
    d[1] = (d[1] % n + n) % n;

    bool b = d[1] & 1;
    int boy[2] = {};

    rep(i, 2)
    {
	b = !b;
	boy[i] = (n + i - d[b] + b) % n + 1;
    }

    for(int i = 0, topi = n >> 1; i < topi; ++i)
    {
	printf("%d %d ", boy[0], boy[1]);
	rep(i, 2)
	{
	    boy[i] = (boy[i] + 1) % n + 1;
	}
    }

    return 0;
}


#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);

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

    int d[2] = {0, 1}, type, x;
    rep(i, q)
    {
	cin >> type;
	switch(type)
	{
	case 1:
	    cin >> x;
	    d[0] += x;
	    d[1] += x;
	    break;
	case 2:
	    x = (d[0] & 1 ? -1 : 1);
	    d[0] += x;
	    d[1] -= x;
	    break;
	}
    }

    d[0] = (d[0] % n + n) % n;
    d[1] = (d[1] % n + n) % n;

    bool b = d[1] & 1;
    int boy[2] = {};

    rep(i, 2)
    {
	b = !b;
	boy[i] = (n + i - d[b] + b) % n + 1;
    }

    for(int i = 0, topi = n >> 1; i < topi; ++i)
    {
	cout << boy[0] << ' ' << boy[1] << ' ';
	rep(i, 2)
	{
	    boy[i] = (boy[i] + 2) % n;
	}
    }

    return 0;
}


#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);

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

    int d[2] = {0, 1}, type, x;
    rep(i, q)
    {
	cin >> type;
	switch(type)
	{
	case 1:
	    cin >> x;
	    d[0] += x;
	    d[1] += x;
	    break;
	case 2:
	    x = (d[0] & 1 ? -1 : 1);
	    d[0] += x;
	    d[1] -= x;
	    break;
	}
    }

    d[0] = (d[0] % n + n) % n;
    d[1] = (d[1] % n + n) % n;

    bool b = d[1] & 1;
    int boy[2] = {};

    rep(i, 2)
    {
	b = !b;
	boy[i] = (n + i - d[b] + b) % n + 1;
    }

    for(int i = 0, topi = n >> 1; i < topi; ++i)
    {
	cout << boy[0] << ' ' << boy[1] << ' ';
	rep(i, 2)
	{
	    boy[i] = (boy[i] + 1) % n + 1;
	}
    }

    return 0;
}


#include <cstdio>

#define rep(i, n) for(int i = 0; i < n; i++)

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

    long long int d[2] = {0LL, 1LL}, x;
    int type;
    rep(i, q)
    {
	scanf("%d", &type);
	switch(type)
	{
	case 1:
	    scanf("%I64d", &x);
	    rep(i, 2)
	    {
		d[i] += x;
	    }
	    break;
	case 2:
	    x = (d[0] & 1 ? -1 : 1);
	    d[0] += x;
	    d[1] -= x;
	    break;
	}
    }

    d[0] = (d[0] % n + n) % n;
    d[1] = (d[1] % n + n) % n;

    bool b = d[1] & 1;
    int boy[2] = {};
    rep(i, 2)
    {
	b = !b;
	boy[i] = n + i - d[b] + b - 1;
	if(n == 2)
	    boy[i] &= 1;
    }

    for(int i = 0, topi = n >> 1; i < topi; ++i)
    {
	rep(i, 2)
	{
	    boy[i] = boy[i] + 2;
	    if(boy[i] > n)
		boy[i] -= n;
	}
	printf("%d %d ", boy[0], boy[1]);
    }

    return 0;
}


#include <cstdio>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

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

    long long int d[2] = {0, 1}, type, x;
    rep(i, q)
    {
	scanf("%d", &type);
	switch(type)
	{
	case 1:
	    scanf("%d", &x);
	    rep(i, 2)
	    {
		d[i] += x;
		d[i] %= n;
	    }
	    break;
	case 2:
	    x = (d[0] & 1 ? -1 : 1);
	    d[0] += x;
	    d[1] -= x;
	    break;
	}
    }

    d[0] = (d[0] % n + n) % n;
    d[1] = (d[1] % n + n) % n;

    bool b = d[1] & 1;
    int boy[2] = {};

    rep(i, 2)
    {
	b = !b;
	boy[i] = (n + i - d[b] + b) % n + 1;
    }

    for(int i = 0, topi = n >> 1; i < topi; ++i)
    {
	printf("%d %d ", boy[0], boy[1]);
	rep(i, 2)
	{
	    boy[i] = (boy[i] + 1) % n + 1;
	}
    }

    return 0;
}


#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);

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

    int d[2] = {0, 1}, type, x;
    rep(i, q)
    {
	cin >> type;
	switch(type)
	{
	case 1:
	    cin >> x;
	    d[0] += x;
	    d[1] += x;
	    break;
	case 2:
	    x = (d[0] & 1 ? -1 : 1);
	    d[0] += x;
	    d[1] -= x;
	    break;
	}
    }

    d[0] = (d[0] % n + n) % n;
    d[1] = (d[1] % n + n) % n;

    bool b = d[1] & 1;
    rep(i, n)
    {
	b = !b;
	cout << (n + i - d[b] + b) % n + 1 << ' ';
    }

    return 0;
}


#include <cstdio>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

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

    long long int d[2] = {0LL, 1LL}, x;
    int type;
    rep(i, q)
    {
	scanf("%d", &type);
	switch(type)
	{
	case 1:
	    scanf("%I64d", &x);
	    rep(i, 2)
	    {
		d[i] += x;
		d[i] %= n;
	    }
	    break;
	case 2:
	    x = (d[0] & 1 ? -1 : 1);
	    d[0] += x;
	    d[1] -= x;
	    break;
	}
    }

    d[0] = (d[0] % n + n) % n;
    d[1] = (d[1] % n + n) % n;

    bool b = d[1] & 1;
    int boy[2] = {};

    rep(i, 2)
    {
	b = !b;
	boy[i] = (n + i - d[b] + b) % n + 1;
    }

    for(int i = 0, topi = n >> 1; i < topi; ++i)
    {
	printf("%d %d ", boy[0], boy[1]);
	rep(i, 2)
	{
	    boy[i] = (boy[i] + 1) % n + 1;
	}
    }

    return 0;
}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    int n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        scanf("%d",&x);
        if(x == 1)
        {
             scanf("%d",&x);
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }

}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    ll n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    while(q--)
    {
        cin>>x;
        if(x == 1)
        {
            cin>>x;
            val+=x;
        }
        else
        {
            odd++;
            even--;
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    cin.tie(0);
    int n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        cin>>x
        if(x == 1)
        {
             cin>>x;
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }

}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    ll n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        cin>>x;
        if(x == 1)
        {
            cin>>x;
            val+=x;
            if(x&1)flag=0;
            else flag=1;
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    ll n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        cin>>x;
        if(x == 1)
        {
            cin>>x;
            val+=x;
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
          odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    ll n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        cin>>x;
        if(x == 1)
        {
            cin>>x;
            val+=x;
            if(x&1)flag=1;
            else flag=0;
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    ll n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        scanf(%l64d,&x);
        if(x == 1)
        {
             scanf(%l64d,&x);
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    int n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        //cin>>x;
        scanf("%d",&x);
        if(x == 1)
        {
            //cin>>x;
             scanf("%d",&x);
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }

}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    int n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        //cin>>x;
        scanf("%d",&x);
        if(x == 1)
        {
            //cin>>x;
             scanf("%d",&x);
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        indx%=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
       printf("%d ",ans[i]);
    }

}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    ll n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        scanf("%l64d",&x);
        if(x == 1)
        {
             scanf("%l64d",&x);
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
}


#include<stdio.h>
#include<stdlib.h>

long long ans[1000005];
int main()
{

    int n, q,x;
    scanf("%d%d",&n,&q);
    long long odd=0,even=0,val=0;
    int flag = 1;
    while(q--)
    {
        //cin>>x;
        scanf("%d",&x);
        if(x == 1)
        {
            //cin>>x;
             scanf("%d",&x);
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        long long indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
       indx%=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
       printf("%d ",ans[i]);
    }

}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    ll n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        cin>>x;
        if(x == 1)
        {
            cin>>x;
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    cin.tie(0);
    int n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 1;
    while(q--)
    {
        cin>>x;
        if(x == 1)
        {
             cin>>x;
            val+=x;
            if(x&1){
                flag = !flag;
            }
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 0;
           }else{
           odd--;
           even++;
           flag = 1;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }

}


#include <bits/stdc++.h>
///
//just hope that someday she will be mine or
///i just forget about her
using namespace std;
#define ll long long
const ll INF = (ll) LLONG_MAX;
//#define ln length()
#define pb push_back
#define sz size
#define mp make_pair
#define qq  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(n)   (n).begin(),(n).end()
#define ii pair<int,int>
#define vii vector<pair<int,int> >
#define vll vector<pair<ll,ll> >
#define vi vector <int>
#define F first
#define S second
#define fcin(n,x) for(int i=0;i<n;cin>>x[i++])
#define fcout(n,x) for(int i=0;i<n;cout<<x[i++]<<" ")
#define cn(v) scanf("%d",&v)
#define cn2(v,w) scanf("%d %d",&v,&w)
#define cn3(v,w,z) scanf("%d %d %d",&v,&w,&z)
#define endl "\n"
#define EPS 1e-12
#define for2c(n,m,mat) for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
#define fori(it, v) for(typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OO INT_MAX

//directions
int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };
int dx8[9] = { 1,0,-1,0,1,-1,-1,1,0 };
int dy8[9] = {  0,1,0,-1,1,-1,1,-1,0};
///commenly used function s :) :) :) : )//
//priority_queue<int, vector<int>, std::greater<int> > first;
ll ipow(ll base,ll exp)
{
    ll result = 1;
    while (exp)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        base *= base;
    }

    return result;
}
string tos(ll n)
{
    stringstream ss;
    string ans;
    ss << n;
    ss >> ans;
    return ans;
}
ll toll(string n)
{
    return atoll(n.c_str());
}
double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int doubleCompare(double x, double y)
{
    if (fabs(x - y) <= 1e-100)
        return 0;

    if (x < y)
        return -1;

    return 1;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//new code ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll ans[1000005];
int main()
{
    qq;
    ll n, q,x;
    cin>>n>>q;
    ll odd=0,even=0,val=0;
    bool flag = 0;
    while(q--)
    {
        cin>>x;
        if(x == 1)
        {
            cin>>x;
            val+=x;
        }
        else
        {
           if(flag){
           odd++;
           even--;
           flag = 1;
           }else{
          odd--;
           even++;
           flag = 0;
           }
        }
    }

    for(int i=1;i<=n;i++){
        ll indx = (i-1) + val ;
        if(i&1)indx+=odd;
        else indx+=even;
        while(indx>=n)indx-=n;
        while(indx<0)indx+=n;
        ans[indx]=i;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <ctime>
using namespace std;

#define inf 2147483647
#define eps 0.0000000001
#define e  2.718281828459
#define pi 3.1415926535897932
#define mod 1000000007

#define LL long long
#define ULL unsigned long long
#define LD long double
#define ULD unsigned long double

//	srand(time(NULL));
//	cout<<fixed<<setprecision(3)<<"\nExecution time="<<clock()/1000.0<<endl;
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);

LL a[2000005], b[2000005];

LL c[2000005], d[2000005];

int main()
{
	LL n, q;
	LL odd = 0, even = 0;
	cin >> n >> q;

	LL t, m;
	for (LL i = 1; i <= q; ++i) {
		scanf("%I64d", &c[i]);
		if (c[i] == 1)
			scanf("%I64d", &d[i]);
	}

	for (LL i = 1; i <= q; i++)
	{
		if (i + 1 <= q && c[i] == 2 && c[i + 1] == 2) {
			i++;
			continue;
		}
		t = c[i];
		m = d[i];

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

	for (LL i = 1; i <= n; i++) {
		LL tmp;
		if (i % 2) tmp = i + odd;
		else tmp = i + even;
			if (tmp > 0) tmp = tmp%n;
			else tmp = tmp + n;
			if (tmp == 0)
				tmp = n;
			b[tmp] = i;
		}

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

	cout << endl;

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <ctime>
using namespace std;

#define inf 2147483647
#define eps 0.0000000001
#define e  2.718281828459
#define pi 3.1415926535897932
#define mod 1000000007

#define LL long long
#define ULL unsigned long long
#define LD long double
#define ULD unsigned long double

//	srand(time(NULL));
//	cout<<fixed<<setprecision(3)<<"\nExecution time="<<clock()/1000.0<<endl;
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);

LL a[2000005], b[2000005];

LL c[2000005], d[2000005];

int main()
{
	LL n, q;
	LL odd = 0, even = 0;
	cin >> n >> q;

	LL t, m;
	for (LL i = 1; i <= q; ++i) {
		scanf("%I64d", &c[i]);
		if (c[i] == 1)
			scanf("%I64d", &d[i]);
	}

	for (LL i = 1; i <= q; i++)
	{
		if (i + 1 <= q && c[i] == 2 && c[i + 1] == 2) {
			i++;
			continue;
		}
		t = c[i];
		m = d[i];

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

	for (LL i = 1; i <= n; i++) {
		LL tmp;
		if (i % 2) tmp = i + odd;
		else tmp = i + even;
			if (tmp > 0) tmp = tmp%n;
			else tmp = tmp + n;
			if (tmp == 0)
				tmp = n;
			b[tmp] = i;
		}

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

	cout << endl;

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <ctime>
using namespace std;

#define inf 2147483647
#define eps 0.0000000001
#define e  2.718281828459
#define pi 3.1415926535897932
#define mod 1000000007

#define LL long long
#define ULL unsigned long long
#define LD long double
#define ULD unsigned long double

//	srand(time(NULL));
//	cout<<fixed<<setprecision(3)<<"\nExecution time="<<clock()/1000.0<<endl;
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);

LL a[2000005], b[2000005];

LL c[2000005], d[2000005];

int main()
{
	LL n, q;
	LL odd = 0, even = 0;
	cin >> n >> q;

	LL t, m;
	for (LL i = 1; i <= q; ++i) {
		scanf("%I64d", &c[i]);
		if (c[i] == 1)
			scanf("%I64d", &d[i]);
	}

	for (LL i = 1; i <= q; i++)
	{
		if (i + 1 <= q && c[i] == 2 && c[i + 1] == 2) {
			i++;
			continue;
		}
		t = c[i];
		m = d[i];

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

	for (LL i = 1; i <= n; i++) {
		LL tmp;
		if (i % 2) tmp = i + odd;
		else tmp = i + even;
			if (tmp > 0) tmp = tmp%n;
			else tmp = tmp + n;
			if (tmp == 0)
				tmp = n;
			b[tmp] = i;
		}

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

	cout << endl;

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <ctime>
using namespace std;

#define inf 2147483647
#define eps 0.0000000001
#define e  2.718281828459
#define pi 3.1415926535897932
#define mod 1000000007

#define LL long long
#define ULL unsigned long long
#define LD long double
#define ULD unsigned long double

//	srand(time(NULL));
//	cout<<fixed<<setprecision(3)<<"\nExecution time="<<clock()/1000.0<<endl;
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);

LL a[2000005], b[2000005];

LL c[2000005], d[2000005];

int main()
{
	LL n, q;
	LL odd = 0, even = 0;
	cin >> n >> q;

	LL t, m;
	for (LL i = 1; i <= q; ++i) {
		scanf("%I64d", &c[i]);
		if (c[i] == 1)
			scanf("%I64d", &d[i]);
	}

	for (LL i = 1; i <= q; i++)
	{
		if (i + 1 <= q && c[i] == 2 && c[i + 1] == 2) {
			i++;
			continue;
		}
		t = c[i];
		m = d[i];

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

	for (LL i = 1; i <= n; i++) {
		LL tmp;
		if (i % 2) tmp = i + odd;
		else tmp = i + even;
			if (tmp > 0) tmp = tmp%n;
			else tmp = tmp + n;
			if (tmp == 0)
				tmp = n;
			b[tmp] = i;
		}

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

	cout << endl;

	return 0;
}


#include <iostream>
using namespace std;;

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

	int command, shift;
	int *Boy = new int[n];
	int *tmp = new int[n];

	int last_command = 1, total_shift = 0;

	for (int i = 0; i < n; i++)
		Boy[i] = i;

	for (int i = 0; i < q; i++)
	{
		cin >> command;

		if (last_command == 1 && command == 1)
		{
			cin >> shift;
			total_shift += shift;
			continue;
		}
		else if (last_command == 1 && command == 2)
		{
			shift = total_shift%n;
			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n - shift; j < n; j++)
					tmp[j - (n - shift)] = Boy[j];

				for (int j = n - 1; j >= 0; j--)
					if (j < shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}

		last_command = 1;
		total_shift = 0;

		if (command == 2)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j],Boy[j+1]);
		}
		else
		{
			cin >> shift;

			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n-shift; j < n; j++)
					tmp[j-(n-shift)] = Boy[j];

				for (int j = n-1; j >= 0; j--)
					if (j<shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}
	}

	if (last_command == 1)
	{
		shift = total_shift%n;
		if (shift < 0)
		{
			shift = -shift;

			for (int j = 0; j < shift; j++)
				tmp[j] = Boy[j];

			for (int j = 0; j < n; j++)
				if (j + shift >= n) Boy[j] = tmp[j + shift - n];
				else Boy[j] = Boy[j + shift];
		}
		else
		{
			for (int j = n - shift; j < n; j++)
				tmp[j - (n - shift)] = Boy[j];

			for (int j = n - 1; j >= 0; j--)
				if (j < shift) Boy[j] = tmp[j];
				else Boy[j] = Boy[j - shift];

		}
	}

	for (int i = 0; i < n; i++)
		cout << Boy[i]+1 << " ";

	delete[] Boy;
	delete[] tmp;

	//system("pause");
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, q, x;
	cin >> n >> q;

	int command;
	int a = 0, b = 1;

	for (int i = 0; i < q; i++)
	{
		cin >> command;
		if (command == 1)
		{
			cin >> x;
			a = (a + x + n) % n;
			b = (b + x + n) % n;
		}
		else if (a % 2 == 0)
		{
			a++;
			b--;
		}
		else
		{
			a--;
			b++;
		}
	}

	for (int i = 0; i < n; i++)
		if (i % 2 == a % 2)
			cout << (i - a + n) % n + 1 << " ";
		else cout << (i - b + n) % n + 2 << " ";

	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, q, x;
	scanf("%i %i", &n, &q);

	int command;
	int a = 0, b = 1;

	for (int i = 0; i < q; i++)
	{
		scanf("%i", &command);
		if (command == 1)
		{
			scanf("%i", &x);
			a = (a + x + n) % n;
			b = (b + x + n) % n;
		}
		else if (a % 2 == 0)
		{
			a++;
			b--;
		}
		else
		{
			a--;
			b++;
		}
	}

	for (int i = 0; i < n; i++)
		if (i % 2 == a % 2)
			printf("%i ", (i - a + n) % n + 1);
		else printf("%i ", (i - b + n) % n + 2);

	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, q, x;
	cin >> n >> q;

	int command;
	int a = 0, b = 1;

	for (int i = 0; i < q; i++)
	{
		cin >> command;
		if (command == 1)
		{
			cin >> x;
			a += x;
			b += x;
		}
		else if (a % 2 == 0)
		{
			a++;
			b--;
		}
		else
		{
			a--;
			b++;
		}
	}

	a %= n;
	b %= n;

	for (int i = 0; i < n; i++)
		if (i % 2 == a % 2)
			cout << (i - a + n) % n + 1 << " ";
		else cout << (i - b + n) % n + 2 << " ";

	return 0;
}


#include <iostream>
using namespace std;;

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

	int command, shift;
	int *Boy = new int[n];
	int *tmp = new int[n];

	int last_command = 0, total_shift;

	for (int i = 0; i < n; i++)
		Boy[i] = i;

	for (int i = 0; i < q; i++)
	{
		cin >> command;

		if (last_command == 1 && command == 1)
		{
			cin >> shift;
			total_shift += shift;
			continue;
		}
		else if (last_command == 1 && command == 2)
		{
			shift = total_shift;
			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n - shift; j < n; j++)
					tmp[j - (n - shift)] = Boy[j];

				for (int j = n - 1; j >= 0; j--)
					if (j < shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
			continue;
		}

		last_command = 1;
		total_shift = 0;

		if (command == 2)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j],Boy[j+1]);
		}
		else
		{
			cin >> shift;

			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n-shift; j < n; j++)
					tmp[j-(n-shift)] = Boy[j];

				for (int j = n-1; j >= 0; j--)
					if (j<shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}
	}

	if (last_command == 1)
	{
		shift = total_shift;
		if (shift < 0)
		{
			shift = -shift;

			for (int j = 0; j < shift; j++)
				tmp[j] = Boy[j];

			for (int j = 0; j < n; j++)
				if (j + shift >= n) Boy[j] = tmp[j + shift - n];
				else Boy[j] = Boy[j + shift];
		}
		else
		{
			for (int j = n - shift; j < n; j++)
				tmp[j - (n - shift)] = Boy[j];

			for (int j = n - 1; j >= 0; j--)
				if (j < shift) Boy[j] = tmp[j];
				else Boy[j] = Boy[j - shift];

		}
	}

	for (int i = 0; i < n; i++)
		cout << Boy[i]+1 << " ";

	delete[] Boy;
	delete[] tmp;

	//system("pause");
	return 0;
}


#include <iostream>
using namespace std;;

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

	int command, shift;
	int *Boy = new int[n];
	int *tmp = new int[n];

	int last_command = 1, total_shift = 0;

	for (int i = 0; i < n; i++)
		Boy[i] = i;

	for (int i = 0; i < q; i++)
	{
		cin >> command;

		if (last_command == 1 && command == 1)
		{
			cin >> shift;
			total_shift += shift;
			continue;
		}

		if (last_command == 2 && command == 2)
		{
			total_shift++;
			continue;
		}

		if (last_command == 1 && command == 2)
		{
			shift = total_shift%n;
			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n - shift; j < n; j++)
					tmp[j - (n - shift)] = Boy[j];

				for (int j = n - 1; j >= 0; j--)
					if (j < shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}

		if (last_command == 2 && command == 1 && total_shift%2==1)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j], Boy[j + 1]);
		}

		last_command = command;
		total_shift = 0;

		if (command == 2)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j],Boy[j+1]);
		}
		else
		{
			cin >> shift;

			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n-shift; j < n; j++)
					tmp[j-(n-shift)] = Boy[j];

				for (int j = n-1; j >= 0; j--)
					if (j<shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}
	}

	if (last_command == 1)
	{
		shift = total_shift%n;
		if (shift < 0)
		{
			shift = -shift;

			for (int j = 0; j < shift; j++)
				tmp[j] = Boy[j];

			for (int j = 0; j < n; j++)
				if (j + shift >= n) Boy[j] = tmp[j + shift - n];
				else Boy[j] = Boy[j + shift];
		}
		else
		{
			for (int j = n - shift; j < n; j++)
				tmp[j - (n - shift)] = Boy[j];

			for (int j = n - 1; j >= 0; j--)
				if (j < shift) Boy[j] = tmp[j];
				else Boy[j] = Boy[j - shift];

		}
	}

	for (int i = 0; i < n; i++)
		cout << Boy[i]+1 << " ";

	delete[] Boy;
	delete[] tmp;

	//system("pause");
	return 0;
}


#include <iostream>
using namespace std;;

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

	_asm
	{
		mov eax, 0
	}

	int command, shift;
	int *Boy = new int[n];
	int *tmp = new int[n];

	for (int i = 0; i < n; i++)
		Boy[i] = i;

	for (int i = 0; i < q; i++)
	{
		cin >> command;
		if (command == 2)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j],Boy[j+1]);
		}
		else
		{
			cin >> shift;

			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n-shift; j < n; j++)
					tmp[j-(n-shift)] = Boy[j];

				for (int j = n-1; j >= 0; j--)
					if (j<shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}
	}

	for (int i = 0; i < n; i++)
		cout << Boy[i]+1 << " ";

	delete[] Boy;
	delete[] tmp;

	//system("pause");
	return 0;
}


#include <iostream>
using namespace std;;

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

	int command, shift;
	int *Boy = new int[n];
	int *tmp = new int[n];

	int last_command = 0, total_shift;

	for (int i = 0; i < n; i++)
		Boy[i] = i;

	for (int i = 0; i < q; i++)
	{
		cin >> command;

		if (last_command == 1 && command == 1)
		{
			cin >> shift;
			total_shift += shift;
			continue;
		}
		else if (last_command == 1 && command == 2)
		{
			shift = total_shift;
			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n - shift; j < n; j++)
					tmp[j - (n - shift)] = Boy[j];

				for (int j = n - 1; j >= 0; j--)
					if (j < shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
			continue;
		}

		last_command = 1;
		total_shift = 0;

		if (command == 2)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j],Boy[j+1]);
		}
		else
		{
			cin >> shift;

			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n-shift; j < n; j++)
					tmp[j-(n-shift)] = Boy[j];

				for (int j = n-1; j >= 0; j--)
					if (j<shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}
	}

	if (last_command == 1)
	{
		shift = total_shift;
		if (shift < 0)
		{
			shift = -shift;

			for (int j = 0; j < shift; j++)
				tmp[j] = Boy[j];

			for (int j = 0; j < n; j++)
				if (j + shift >= n) Boy[j] = tmp[j + shift - n];
				else Boy[j] = Boy[j + shift];
		}
		else
		{
			for (int j = n - shift; j < n; j++)
				tmp[j - (n - shift)] = Boy[j];

			for (int j = n - 1; j >= 0; j--)
				if (j < shift) Boy[j] = tmp[j];
				else Boy[j] = Boy[j - shift];

		}
	}

	for (int i = 0; i < n; i++)
		cout << Boy[i]+1 << " ";

	delete[] Boy;
	delete[] tmp;

	system("pause");
	return 0;
}


#include <iostream>
using namespace std;;

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

	int command, shift;
	int *Boy = new int[n];
	int *tmp = new int[n];

	int last_command = 1, total_shift = 0;

	for (int i = 0; i < n; i++)
		Boy[i] = i;

	for (int i = 0; i < q; i++)
	{
		cin >> command;

		if (last_command == 1 && command == 1)
		{
			cin >> shift;
			total_shift += shift;
			continue;
		}

		if (last_command == 2 && command == 2)
		{
			total_shift++;
			continue;
		}

		if (last_command == 1 && command == 2)
		{
			shift = total_shift%n;
			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n - shift; j < n; j++)
					tmp[j - (n - shift)] = Boy[j];

				for (int j = n - 1; j >= 0; j--)
					if (j < shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}

		if (last_command == 1 && command == 2 && total_shift%2==1)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j], Boy[j + 1]);
		}

		last_command = command;
		total_shift = 0;

		if (command == 2)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j],Boy[j+1]);
		}
		else
		{
			cin >> shift;

			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n-shift; j < n; j++)
					tmp[j-(n-shift)] = Boy[j];

				for (int j = n-1; j >= 0; j--)
					if (j<shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}
	}

	if (last_command == 1)
	{
		shift = total_shift%n;
		if (shift < 0)
		{
			shift = -shift;

			for (int j = 0; j < shift; j++)
				tmp[j] = Boy[j];

			for (int j = 0; j < n; j++)
				if (j + shift >= n) Boy[j] = tmp[j + shift - n];
				else Boy[j] = Boy[j + shift];
		}
		else
		{
			for (int j = n - shift; j < n; j++)
				tmp[j - (n - shift)] = Boy[j];

			for (int j = n - 1; j >= 0; j--)
				if (j < shift) Boy[j] = tmp[j];
				else Boy[j] = Boy[j - shift];

		}
	}

	for (int i = 0; i < n; i++)
		cout << Boy[i]+1 << " ";

	delete[] Boy;
	delete[] tmp;

	//system("pause");
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, q, x;
	cin >> n >> q;

	int command;
	int a = 0, b = 1;

	for (int i = 0; i < q; i++)
	{
		cin >> command;
		if (command == 1)
		{
			cin >> x;
			a += x;
			b += x;
		}
		else if (a % 2 == 0)
		{
			a++;
			b--;
		}
		else
		{
			a--;
			b++;
		}
	}

	a = abs((a+n)%n);
	b = abs((b+n)%n);

	for (int i = 0; i < n; i++)
		if (i % 2 == a % 2)
			cout << (i - a + n) % n + 1 << " ";
		else cout << (i - b + n) % n + 2 << " ";

	return 0;
}


#include <iostream>
using namespace std;;

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

	int command, shift;
	int *Boy = new int[n];
	int *tmp = new int[n];

	int last_command = 0, total_shift;

	for (int i = 0; i < n; i++)
		Boy[i] = i;

	for (int i = 0; i < q; i++)
	{
		cin >> command;

		if (last_command == 1 && command == 1)
		{
			cin >> shift;
			total_shift += shift;
			continue;
		}
		else if (last_command == 1 && command == 2)
		{
			shift = total_shift;
			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n - shift; j < n; j++)
					tmp[j - (n - shift)] = Boy[j];

				for (int j = n - 1; j >= 0; j--)
					if (j < shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}

		last_command = 1;
		total_shift = 0;

		if (command == 2)
		{
			for (int j = 0; j < n; j += 2)
				swap(Boy[j],Boy[j+1]);
		}
		else
		{
			cin >> shift;

			if (shift < 0)
			{
				shift = -shift;

				for (int j = 0; j < shift; j++)
					tmp[j] = Boy[j];

				for (int j = 0; j < n; j++)
					if (j + shift >= n) Boy[j] = tmp[j + shift - n];
					else Boy[j] = Boy[j + shift];
			}
			else
			{
				for (int j = n-shift; j < n; j++)
					tmp[j-(n-shift)] = Boy[j];

				for (int j = n-1; j >= 0; j--)
					if (j<shift) Boy[j] = tmp[j];
					else Boy[j] = Boy[j - shift];

			}
		}
	}

	if (last_command == 1)
	{
		shift = total_shift;
		if (shift < 0)
		{
			shift = -shift;

			for (int j = 0; j < shift; j++)
				tmp[j] = Boy[j];

			for (int j = 0; j < n; j++)
				if (j + shift >= n) Boy[j] = tmp[j + shift - n];
				else Boy[j] = Boy[j + shift];
		}
		else
		{
			for (int j = n - shift; j < n; j++)
				tmp[j - (n - shift)] = Boy[j];

			for (int j = n - 1; j >= 0; j--)
				if (j < shift) Boy[j] = tmp[j];
				else Boy[j] = Boy[j - shift];

		}
	}

	for (int i = 0; i < n; i++)
		cout << Boy[i]+1 << " ";

	delete[] Boy;
	delete[] tmp;

	//system("pause");
	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
	string s;
	cin >> s;

	bool f = false;

	for (int i = 1; i < s.length(); i++)
	{
		if (s[i] == s[i - 1])
		{
			if (f)
			{
				char newChar = s[i] + 1;
				if (newChar == '{') newChar = 'a';
				s[i - 1] = newChar;
				f = false;
			}
			else
			{
				char newChar = s[i-1] + 1;
				if (newChar == '{') newChar = 'a';
				s[i] = newChar;
				f = true;
			}
		}
		else f = false;
	}

	cout << s << endl;

	return 0;
}


#include <iostream>
using namespace std;

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

	int p = 0;
	int count = 0;
	int count2 = 0;

	bool pair = false;
	bool prevCommandIs2 = false;

	int command;
	int x;

	for (int i = 0; i < q; ++i)
	{
		cin >> command;

		if (command == 1)
		{
			cin >> x;

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

			if (abs(x) % 2 == 1)
			{
				++count;
			}
			prevCommandIs2 = false;
		}
		else if (command == 2)
		{
			pair = !pair;

			if (i >= 1 && prevCommandIs2)
			{
				--count2;
				prevCommandIs2 = false;
			}
			else
			{
				++count2;
				prevCommandIs2 = true;
			}

		}

	}
	if (pair)
	{
		if (count % 2 == 0)
		{
			for (int i = p; i < p + n; i += 2)
			{
				int prev = (i + 1) % n + 1;
				int next = i % n + 1;
				cout << prev << ' ' << next << ' ';
			}
		}

		if (count % 2 == 1)
		{
			for (int i = p; i < p + n; i += 2)
			{
				int prev = (i - 1) % n + 1;
				int next = (i + 2) % n + 1;
				cout << prev << ' ' << next << ' ';
			}
		}
	}
	else if (count % 2 == 1 && count2 != 0)
	{
		for (int i = p; i < p + n; i += 2)
		{
			int prev = (i + 2) % n + 1;
			int next = prev - 3;
			if (next <= 0) next += n;
			cout << prev << ' ' << next << ' ';

		}
	}
	else
	{
		for (int i = p; i < p + n; ++i)
		{
			cout << (i % n + 1) << ' ';
		}
	}

	return 0;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

#define PB push_back
#define F first
#define S second
#define MP make_pair

#define PI acos(-1)
#define EPS 1e-9
#define inf 100000000
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < EPS; }

//
//debug
#ifdef yamin
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif // yamin

#define MX 1010000

int ans[MX];

int main () {

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

    ll one = 0, two = 1;

    while ( q-- ) {

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

            if ( d == 1 ) {

                    int x; scanf ( "%d", &x );
                    one += x;
                    two += x;

            }

            else {

                    if ( one % 2 == 0 ) one++;
                    else one--;

                    if ( two % 2 == 0 ) two++;
                    else two--;

            }

    }

    one %= n; two %= n; if ( one < 0 ) one += n; if ( two < 0 ) two += n;
    dbg ( one, two );

    for ( int i = one, j = 1; j <= n; j += 2, i = ( i + 2 ) % n ) ans[i] = j;
    for ( int i = two, j = 2; j <= n; j += 2, i = ( i + 2 ) % n ) ans[i] = j;

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

    return 0;

}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

#define PB push_back
#define F first
#define S second
#define MP make_pair

#define PI acos(-1)
#define EPS 1e-9
#define inf 100000000
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < EPS; }

//
//debug
#ifdef yamin
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif // yamin

#define MX 1010000

int ans[MX];
vi store;

int main () {

    ios_base::sync_with_stdio(0);

    int n, q, shift = 0; cin >> n >> q;

    while ( q-- ) {

            int d; cin >> d;
            if ( d == 1 ) {

                    int x; cin >> x; shift += x;

            }

            else {

                    store.PB ( shift );

            }

    }

    int posone = ( ( shift % n ) + n ) % n, postwo;

    if ( posone == n-1 ) postwo = 0;
    else postwo = 1 + posone;
    dbg ( posone, postwo );

    for ( int i = 0; i < store.size(); ++i ) {

            if ( abs ( store[i] ) % 2 == 0 ) {

                    posone = ( posone + 1 ) % n;

            }

            else {

                    if ( posone == 1 ) posone = n-1;
                    else posone--;

            }

    }

    for ( int i = 0; i < store.size(); ++i ) {

            if ( abs ( store[i] % 2 == 0 ) ) {

                    if ( postwo == 0 ) postwo = n-1;
                    else postwo--;

            }

            else postwo = ( ( ( postwo + 1 ) % n ) + n ) % n;
            dbg ( postwo );

    }

    dbg ( posone, postwo );

    for ( int i = posone, j = 0; j < n; j += 2 ) {

            ans[i] = j + 1;
            i = ( i + 2 ) % n;

    }

    for ( int i = postwo, j = 1; j < n; j += 2 ) {

            ans[i] = j + 1;
            i = ( i + 2 ) % n;

    }

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

    return 0;

}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

#define PB push_back
#define F first
#define S second
#define MP make_pair

#define PI acos(-1)
#define EPS 1e-9
#define inf 100000000
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < EPS; }

//
//debug
#ifdef yamin
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif // yamin

#define MX 1010000

int ans[MX];

int main () {

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

    ll one = 0, two = 1;

    while ( q-- ) {

            int d; cin >> d;

            if ( d == 1 ) {

                    int x; cin >> x;
                    one += x;
                    two += x;

            }

            else {

                    if ( one % 2 == 0 ) one++;
                    else one--;

                    if ( two % 2 == 0 ) two++;
                    else two--;

                    one %= n; two %= n;

            }

    }

    one %= n; two %= n; if ( one < 0 ) one += n; if ( two < 0 ) two += n;
    dbg ( one, two );

    for ( int i = one, j = 1; j <= n; j += 2, i = ( i + 2 ) % n ) ans[i] = j;
    for ( int i = two, j = 2; j <= n; j += 2, i = ( i + 2 ) % n ) ans[i] = j;

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

    return 0;

}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

#define PB push_back
#define F first
#define S second
#define MP make_pair

#define PI acos(-1)
#define EPS 1e-9
#define inf 100000000
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < EPS; }

//
//debug
#ifdef yamin
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif // yamin

#define MX 1010000

int ans[MX];
vi store;

int main () {

    ios_base::sync_with_stdio(0);

    int n, q, shift = 0; cin >> n >> q;

    while ( q-- ) {

            int d; cin >> d;
            if ( d == 1 ) {

                    int x; cin >> x; shift += x;

            }

            else {

                    store.PB ( shift );

            }

    }

    int posone, postwo;

    if ( shift >= 0 ) {

            posone = shift % n;

    }

    else {

            shift = abs ( shift );
            shift %= n;

            posone = ( n - shift ) % n;

    }

    if ( posone == n-1 ) postwo = 0;
    else postwo = 1 + posone;
    dbg ( posone, postwo );

    for ( int i = 0; i < store.size(); ++i ) {

            if ( abs ( store[i] ) % 2 == 0 ) {

                    posone = ( posone + 1 ) % n;

            }

            else {

                    if ( posone == 0 ) posone = n-1;
                    else posone--;

            }

    }

    for ( int i = 0; i < store.size(); ++i ) {

            if ( abs ( store[i] % 2 == 0 ) ) {

                    if ( postwo == 0 ) postwo = n-1;
                    else postwo--;

            }

            else postwo = ( postwo + 1 ) % n;
            dbg ( postwo );

    }

    dbg ( posone, postwo );

    for ( int i = posone, j = 0; j < n; j += 2 ) {

            ans[i] = j + 1;
            i = ( i + 2 ) % n;

    }

    for ( int i = postwo, j = 1; j < n; j += 2 ) {

            ans[i] = j + 1;
            i = ( i + 2 ) % n;

    }

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

    return 0;

}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

#define PB push_back
#define F first
#define S second
#define MP make_pair

#define PI acos(-1)
#define EPS 1e-9
#define inf 100000000
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < EPS; }

//
//debug
#ifdef yamin
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif // yamin

#define MX 1010000

int ans[MX];

int main () {

    ios_base::sync_with_stdio(0);

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

    int one = 0, two = 1;

    while ( q-- ) {

            int d; cin >> d;

            if ( d == 1 ) {

                    int x; cin >> x;
                    one += x; one %= n;
                    two += x; two %= n;

            }

            else {

                    if ( one % 2 == 0 ) one++;
                    else one--;

                    if ( two % 2 == 0 ) two++;
                    else two--;

                    one %= n; two %= n;

            }

            if ( one < 0 ) one += n;
            if ( two < 0 ) two += n;

    }
    dbg ( one, two );

    for ( int i = one, j = 1; j <= n; j += 2, i = ( i + 2 ) % n ) ans[i] = j;
    for ( int i = two, j = 2; j <= n; j += 2, i = ( i + 2 ) % n ) ans[i] = j;

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

    return 0;

}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

#define PB push_back
#define F first
#define S second
#define MP make_pair

#define PI acos(-1)
#define EPS 1e-9
#define inf 100000000
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < EPS; }

//
//debug
#ifdef yamin
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif // yamin

#define MX 1010000

int ans[MX];
vi store;

int main () {

    ios_base::sync_with_stdio(0);

    int n, q, shift = 0; cin >> n >> q;

    while ( q-- ) {

            int d; cin >> d;
            if ( d == 1 ) {

                    int x; cin >> x; shift += x;

            }

            else {

                    store.PB ( shift );

            }

    }

    int posone = ( ( shift % n ) + n ) % n, postwo;

    if ( posone == n-1 ) postwo = 0;
    else postwo = 1 + posone;
    dbg ( posone, postwo );

    for ( int i = 0; i < store.size(); ++i ) {

            if ( abs ( store[i] ) % 2 == 0 ) {

                    posone = ( posone + 1 ) % n;

            }

            else {

                    if ( posone == 0 ) posone = n-1;
                    else posone--;

            }

    }

    for ( int i = 0; i < store.size(); ++i ) {

            if ( abs ( store[i] % 2 == 0 ) ) {

                    if ( postwo == 0 ) postwo = n-1;
                    else postwo--;

            }

            else postwo = ( ( ( postwo + 1 ) % n ) + n ) % n;
            dbg ( postwo );

    }

    dbg ( posone, postwo );

    for ( int i = posone, j = 0; j < n; j += 2 ) {

            ans[i] = j + 1;
            i = ( i + 2 ) % n;

    }

    for ( int i = postwo, j = 1; j < n; j += 2 ) {

            ans[i] = j + 1;
            i = ( i + 2 ) % n;

    }

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

    return 0;

}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

#define PB push_back
#define F first
#define S second
#define MP make_pair

#define PI acos(-1)
#define EPS 1e-9
#define inf 100000000
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < EPS; }

//
//debug
#ifdef yamin
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif // yamin

#define MX 1010000

int ans[MX];

int main () {

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

    ll one = 0, two = 1;

    while ( q-- ) {

            int d; cin >> d;

            if ( d == 1 ) {

                    int x; cin >> x;
                    one += x;
                    two += x;

            }

            else {

                    if ( one % 2 == 0 ) one++;
                    else one--;

                    if ( two % 2 == 0 ) two++;
                    else two--;

            }

    }

    one %= n; two %= n; if ( one < 0 ) one += n; if ( two < 0 ) two += n;
    dbg ( one, two );

    for ( int i = one, j = 1; j <= n; j += 2, i = ( i + 2 ) % n ) ans[i] = j;
    for ( int i = two, j = 2; j <= n; j += 2, i = ( i + 2 ) % n ) ans[i] = j;

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

    return 0;

}