#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 1;
int n, Q, ans[maxn], temp1, temp2;
int pos1 = 0, pos2 = 1;
int main() {
  scanf("%d%d", &n, &Q);
  for (int i = 1; i <= Q; i++) {
    scanf("%d", &temp1);
    if (temp1 == 2) {
      if (pos1 % 2 == 0) {
        pos1 += 2;
      }
      if (pos2 % 2 == 0) {
        pos2 += 2;
      }
      pos1--;
      pos2--;
    }
    if (temp1 == 1) {
      scanf("%d", &temp2);
      pos1 = (pos1 + temp2 + n);
      pos2 = (pos2 + temp2 + n);
      if (pos1 > n - 1) {
        pos1 -= n;
      }
      if (pos1 > n - 1) {
        pos1 -= n;
      }
      if (pos2 > n - 1) {
        pos2 -= n;
      }
      if (pos2 > n - 1) {
        pos2 -= n;
      }
    }
  }
  int t1 = 3;
  ans[pos1] = 1;
  for (int i = (pos1 + 2) % n; i != pos1; i = (i + 2) % n) {
    ans[i] = t1;
    t1 += 2;
  }
  int t2 = 4;
  ans[pos2] = 2;
  for (int i = (pos2 + 2) % n; i != pos2; i = (i + 2) % n) {
    ans[i] = t2;
    t2 += 2;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
