#include <bits/stdc++.h>
using namespace std;
int a[1000001];
int main() {
  int n, q, r, pos1 = 1, pos2 = 2, s;
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) a[i] = 0;
  for (int i = 0; i < q; i++) {
    scanf("%d", &s);
    if (s == 1) {
      scanf("%d", &r);
      if (r > 0) {
        pos1 = (pos1 + r) % (n);
        pos2 = (pos2 + r) % (n);
        if (pos1 == 0) pos1 = n;
        if (pos2 == 0) pos2 = n;
      } else {
        r = abs(r);
        pos1 = pos1 - r;
        pos2 = pos2 - r;
        if (pos1 <= 0) pos1 = pos1 + n;
        if (pos2 <= 0) pos2 = pos2 + n;
      }
    } else {
      if (pos1 % 2 != 0)
        pos1 = pos1 + 1;
      else
        pos1 = pos1 - 1;
      if (pos2 % 2 != 0)
        pos2 = pos2 + 1;
      else
        pos2 = pos2 - 1;
    }
  }
  if (pos1 == 0) pos1 = n;
  if (pos2 == 0) pos2 = n;
  for (int i = 1; i <= n; i += 2) {
    int p = (pos1 + i - 1) % n;
    if (p == 0) p = n;
    a[p] = i;
  }
  for (int i = 1; i <= n; i += 2) {
    int p = (pos2 + i - 1) % n;
    if (p == 0) p = n;
    a[p] = i + 1;
  }
  for (int i = 1; i <= n; i++) printf("%d ", a[i]);
}
