#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10034217728")
using namespace std;
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  int b[4];
  for (int i = 0; i < 4; i++) b[i] = i;
  for (int i = 0; i < q; i++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int u;
      scanf("%d", &u);
      for (int j = 0; j < 4; j++) {
        b[j] += u;
        b[j] += n;
        b[j] %= n;
      }
    } else {
      for (int j = 0; j < 4; j++) b[j] ^= 1;
    }
  }
  vector<int> ans(n);
  for (int i = 0; i < 4; i++) {
    b[i] -= i;
    b[i] %= n;
    b[i] += n;
    b[i] %= n;
  }
  for (int i = 0; i < n; i++) {
    ans[(i + b[i % 4]) % n] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
