#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
std::vector<long long int> v1, v2;
long long int arr[1000009];
int main() {
  int test_case = 1;
  for (int cs = 1; cs <= test_case; cs++) {
    long long int n, q;
    scanf("%lld %lld", &n, &q);
    long long int sum = 0, xr = 0, odd = 1, even = 2;
    for (int i = 1; i <= q; i++) {
      long long int a;
      scanf("%lld", &a);
      if (a == 2) {
        xr ^= 1;
        if (odd & 1)
          odd++;
        else
          odd--;
        if (even & 1)
          even++;
        else
          even--;
      } else {
        scanf("%lld", &a);
        odd = (odd + a + n) % n;
        even = (even + a + n) % n;
        if (!odd) odd = n;
        if (!even) even = n;
      }
    }
    odd--;
    even = (even - 2 + n) % n;
    for (int i = 1; i <= n; i++) {
      long long int a;
      if (i & 1)
        a = (i + odd) % n;
      else
        a = (i + even) % n;
      if (!a) a = n;
      arr[a] = i;
    }
    for (int i = 1; i <= n; i++) printf("%lld ", arr[i]);
    printf("\n");
  }
  return 0;
}
