#include <bits/stdc++.h>
using namespace std;
int mat[2][(int)5e5 + 5];
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n / 2; i++) {
    mat[0][i] = 2 * i + 1;
    mat[1][i] = 2 * (i + 1);
  }
  int ch = 1, nch = 0, itch = 0, itnc = 0;
  for (int w = 0; w < q; w++) {
    int type;
    scanf("%d", &type);
    if (type == 2) {
      swap(ch, nch);
      swap(itch, itnc);
      bool f = true;
      int j = itnc;
      continue;
    }
    int x;
    scanf("%d", &x);
    if (x < 0) x += n;
    int dx;
    if (abs(x) % 2 == 1) {
      dx = x / 2 + 1;
      if (x < 0) dx = x / 2 - 1;
    } else
      dx = x / 2;
    itch = (itch - dx + n) % (n / 2);
    itnc = (itnc - x / 2 + n) % (n / 2);
    if (abs(x) % 2 == 1) {
      swap(ch, nch);
      swap(itch, itnc);
    }
    bool f = true;
    int j = itnc;
  }
  bool f = true;
  for (int i = itch; i != itch || f; i = (i + 1) % (n / 2)) {
    printf("%d %d ", mat[nch][itnc], mat[ch][i]);
    itnc = (itnc + 1) % (n / 2);
    f = false;
  }
}
