#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N];
int change(int pos, int y, int n) {
  pos = pos + y % n;
  if (pos < 0) {
    pos = n + pos;
  }
  return pos;
}
int main() {
  int n, p, x, y;
  scanf("%d%d", &n, &p);
  int pos_1, pos_2;
  pos_1 = 1;
  pos_2 = 2;
  for (int i = 0; i < p; i++) {
    scanf("%d", &x);
    if (x == 1) {
      scanf("%d", &y);
      pos_1 = change(pos_1, y, n);
      pos_2 = change(pos_2, y, n);
    } else {
      if (pos_1 % 2 == 0) {
        pos_1 -= 1;
        pos_2 += 1;
      } else {
        pos_2 -= 1;
        pos_1 += 1;
      }
    }
    pos_1 %= n;
    pos_2 %= n;
    pos_1 = pos_1 ? pos_1 : n;
    pos_2 = pos_2 ? pos_2 : n;
  }
  for (int i = 0; i < n / 2; i++) {
    a[(2 * i + pos_1) % n] = 1 + 2 * i;
    a[(2 * i + pos_2) % n] = 2 + 2 * i;
  }
  for (int i = 1; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("%d\n", a[0]);
  return 0;
}
