#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long N = 1e6 + 1e2;
int n, m, a, b = 1, l[N], x;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  while (m--) {
    cin >> x;
    if (x == 1) {
      cin >> x;
      a = (a + x + n) % n;
      b = (b + x + n) % n;
    } else {
      if (a % 2) {
        a = (a - 1 + n) % n;
        b = (b + 1) % n;
      } else {
        b = (b - 1 + n) % n;
        a = (a + 1) % n;
      }
    }
  }
  for (int i = 1; i <= n; ++ ++i) {
    l[a] = i;
    l[b] = i + 1;
    a = (a + 2) % n;
    b = (b + 2) % n;
  }
  for (int i = 0; i < n; ++i) cout << l[i] << " ";
}
