#include <bits/stdc++.h>
uint32_t readu32() {
  int c;
  while ((c = getchar_unlocked()) < '0')
    ;
  uint32_t n = c & 15U;
  while ((c = getchar_unlocked()) >= '0') n = n * 10 + (c & 15U);
  return n;
}
uint64_t readu64() {
  int c;
  while ((c = getchar_unlocked()) < '0')
    ;
  uint64_t n = c & 15U;
  while ((c = getchar_unlocked()) >= '0') n = n * 10 + (c & 15U);
  return n;
}
int32_t read32() {
  int c;
  while ((c = getchar_unlocked()) < '-')
    ;
  bool neg = c == '-';
  if (neg) c = getchar_unlocked();
  uint32_t n = c & 15U;
  while ((c = getchar_unlocked()) >= '0') n = n * 10 + (c & 15U);
  return neg ? -(int32_t)n : n;
}
int64_t read64() {
  int c;
  while ((c = getchar_unlocked()) < '-')
    ;
  bool neg = c == '-';
  if (neg) c = getchar_unlocked();
  uint64_t n = c & 15;
  while ((c = getchar_unlocked()) >= '0') n = n * 10 + (c & 15U);
  return neg ? -(int64_t)n : n;
}
using namespace std;
int x[1000000];
int main() {
  ios_base::sync_with_stdio(0);
  int n = (readu32()), q = (readu32());
  int p0 = 0, p1 = 1;
  for (int i = q; i--;) {
    if ((readu32()) == 2) {
      p0 ^= 1;
      p1 ^= 1;
    } else {
      int r = (read32());
      p0 = (p0 + r + 2 * n) % n;
      p1 = (p1 + r + 2 * n) % n;
    }
  }
  for (int i = 0; i < n; i++) {
    int p = ((i & 1 ? p1 : p0) + (i & ~1)) % n;
    x[p] = i;
  }
  for (int i = 0; i < n; i++) printf("%d ", x[i] + 1);
  return 0;
}
