#include <bits/stdc++.h>
int main() {
  int n, m, i, j, choise, s, q, o, a[2000001], t;
  while (scanf("%d%d", &n, &m) != EOF) {
    q = 1;
    o = 2;
    while (m--) {
      scanf("%d", &choise);
      if (choise == 1) {
        scanf("%d", &s);
        q = q + s;
        o = o + s;
        if (q <= 0) {
          q = q + n;
        }
        if (o <= 0) {
          o = o + n;
        }
        if (q > n) q = q - n;
        if (o > n) o = o - n;
      }
      if (choise == 2) {
        if (q % 2) {
          q++;
          o--;
        } else {
          q--;
          o++;
        }
      }
    }
    j = 1;
    t = 2;
    for (i = 1; i <= n / 2; i++) {
      a[o] = t;
      a[q] = j;
      j = j + 2;
      t = t + 2;
      o = o + 2;
      q = q + 2;
      if (o > n) o = o - n;
      if (q > n) q = q - n;
    }
    for (i = 1; i <= n; i++) printf("%d ", a[i]);
  }
  return 0;
}
