#include <bits/stdc++.h>
using namespace std;
int num[1000000 + 50];
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n - 1; i++) num[i] = i;
  int x_1 = 0, x_2 = 1;
  int tt, tt_temp;
  for (int i = 0; i < q; i++) {
    scanf("%d", &tt);
    if (tt == 1) {
      scanf("%d", &tt_temp);
      x_1 += tt_temp;
      x_2 += tt_temp;
      if (x_1 < 0) x_1 = n - (0 - x_1) % n;
      if (x_2 < 0) x_2 = n - (0 - x_2) % n;
      x_1 %= n;
      x_2 %= n;
    } else {
      if (x_1 & 1)
        x_1--;
      else
        x_1++;
      if (x_2 & 1)
        x_2--;
      else
        x_2++;
      if (x_1 < 0)
        x_1++;
      else
        x_1 %= n;
      if (x_2 < 0)
        x_2++;
      else
        x_2 %= n;
    }
  }
  for (int i = 0, k = 1; i < n / 2; i++) {
    num[x_1] = k;
    num[x_2] = k + 1;
    x_2 += 2;
    x_2 %= n;
    x_1 += 2;
    x_1 %= n;
    k += 2;
  }
  printf("%d", num[0]);
  for (int i = 1; i < n; i++) printf(" %d", num[i]);
  printf("\n");
  return 0;
}
