#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned n, q;
  scanf("%u%u", &n, &q);
  unsigned pairs[n];
  int first = 0, second = 1;
  while (q--) {
    unsigned short type;
    scanf("%hd", &type);
    if (type == 1) {
      int x;
      scanf("%d", &x);
      first = (n + x + first) % n;
      second = (n + x + second) % n;
    } else {
      if (first % 2) {
        first = (n + first - 1) % n;
        second = (second + 1) % n;
      } else {
        second = (n + second - 1) % n;
        first = (first + 1) % n;
      }
    }
  }
  for (q = 0; q < n;) {
    pairs[first] = ++q;
    pairs[second] = ++q;
    first = (first + 2) % n;
    second = (second + 2) % n;
  }
  for (q = 0; q < n; q++) printf("%u%c", pairs[q], q < n - 1 ? ' ' : '\n');
  return 0;
}
