#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, a = 1, b = 2, x, y;
  cin >> n >> p;
  while (p--) {
    int a1 = a;
    scanf("%d", &x);
    if (x == 2) {
      a ^= b ^= a ^= b;
      continue;
    }
    scanf("%d", &y);
    if (y & 1)
      a = b - y - 1, b = a1 - y + 1;
    else
      a -= y, b -= y;
    while (a <= 0) a += n;
    while (b <= 0) b += n;
    while (a > n) a -= n;
    while (b > n) b -= n;
  }
  cout << a << " " << b;
  for (int i = 3; i <= n; i++)
    if (i & 1) {
      a += 2;
      if (a > n) a -= n;
      cout << " " << a;
    } else {
      b += 2;
      if (b > n) b -= n;
      cout << " " << b;
    }
  cout << endl;
}
