#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
int a[2][N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int q;
  cin >> q;
  int c = 1;
  for (int i = 1; i <= n / 2; i++) {
    a[0][i] = c;
    c += 2;
  }
  c = 2;
  for (int i = 1; i <= n / 2; i++) {
    a[1][i] = c;
    c += 2;
  }
  int cur = 0;
  int ptr_0 = 1;
  int ptr_1 = 1;
  while (q--) {
    int typ;
    cin >> typ;
    if (typ == 2) {
      cur ^= 1;
    } else {
      int x;
      cin >> x;
      if (x == 0) continue;
      if (x > 0) x = n - x;
      x = abs(x);
      if (x % 2 == 0) {
        ptr_1 += (x / 2);
        ptr_0 += (x / 2);
        if (ptr_1 > n / 2) ptr_1 -= n / 2;
        if (ptr_0 > n / 2) ptr_0 -= n / 2;
      } else {
        if (cur == 1) {
          ptr_1 += ((x + 1) / 2);
          ptr_0 += ((x + 1) / 2) - 1;
          if (ptr_1 > n / 2) ptr_1 -= n / 2;
          if (ptr_0 > n / 2) ptr_0 -= n / 2;
          cur ^= 1;
        } else {
          ptr_0 += ((x + 1) / 2);
          ptr_1 += ((x + 1) / 2) - 1;
          if (ptr_1 > n / 2) ptr_1 -= n / 2;
          if (ptr_0 > n / 2) ptr_0 -= n / 2;
          cur ^= 1;
        }
      }
    }
  }
  for (int i = 0; i < n / 2; i++) {
    if (cur == 0) {
      cout << a[cur][ptr_0] << " " << a[cur ^ 1][ptr_1] << " ";
      ptr_0++;
      ptr_1++;
      if (ptr_0 > n / 2) ptr_0 -= n / 2;
      if (ptr_1 > n / 2) ptr_1 -= n / 2;
    }
    if (cur == 1) {
      cout << a[cur][ptr_1] << " " << a[cur ^ 1][ptr_0] << " ";
      ptr_0++;
      ptr_1++;
      if (ptr_0 > n / 2) ptr_0 -= n / 2;
      if (ptr_1 > n / 2) ptr_1 -= n / 2;
    }
  }
}
