#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int cur = 0, p1 = 0, p2 = 1;
  while (m--) {
    int q, x;
    scanf("%d", &q);
    if (q == 1) {
      scanf("%d", &x);
      cur = (cur - x + n) % n;
    } else {
      if (abs(p1 - cur) % 2 == 0)
        p1 = (p1 + 1) % n;
      else
        p1 = (p1 - 1 + n) % n;
      if (abs(p2 - cur) % 2 == 0)
        p2 = (p2 + 1) % n;
      else
        p2 = (p2 - 1 + n) % n;
    }
  }
  int x = p1, t = 1;
  do {
    a[x] = t;
    x = (x + 2) % n;
    t += 2;
  } while (x != p1);
  x = p2, t = 2;
  do {
    a[x] = t;
    x = (x + 2) % n;
    t += 2;
  } while (x != p2);
  x = cur;
  do {
    printf("%d ", a[x]);
    x = (x + 1) % n;
  } while (x != cur);
  return 0;
}
