#include <bits/stdc++.h>
using namespace std;
const int fx[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
const int fxx[8][2] = {{0, 1}, {0, -1}, {1, 0},  {-1, 0},
                       {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  s << "[";
  for (int i = 0; i < ((int)(t.size())) - 1; i++) s << t[i] << ", ";
  s << t[((int)(t.size())) - 1] << "]";
  return s;
}
const int MOD = 1e9 + 7;
template <typename T>
inline T gcD(T a, T b) {
  if (a < b) swap(a, b);
  while (b) {
    a = a % b;
    b ^= a;
    a ^= b;
    b ^= a;
  };
  return a;
}
template <typename T>
inline T pow_mod(T a, T b) {
  T res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
const int MAXN = 1e6 + 10;
int arr[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  int n, q, t, z;
  scanf("%d", &n);
  scanf("%d", &q);
  long long x = 1, y = 2;
  while (q--) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d", &z);
      x += z;
      y += z;
    } else {
      if (x & 1)
        x++;
      else
        x--;
      if (y & 1)
        y++;
      else
        y--;
    }
  }
  x %= n;
  y %= n;
  if (x < 0) x += n;
  if (y < 0) y += n;
  for (int i = 0; i < n / 2; i++) {
    int v1 = 1 + 2 * i;
    int v2 = 2 + 2 * i;
    arr[x] = v1;
    arr[y] = v2;
    x += 2;
    y += 2;
    if (x >= n) x -= n;
    if (y >= n) y -= n;
  }
  for (int i = 1; i < n; i++) {
    printf("%d", arr[i]);
    putchar(' ');
  }
  printf("%d", arr[0]);
  printf("\n");
  return 0;
}
