#include <bits/stdc++.h>
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return ((a * b) / gcd(a, b)); }
using namespace std;
long long ara[1000006];
int main() {
  int b, c, i, j, k, tc, t;
  int m, cnt = 0;
  long long one = 1, two = 2, a, n;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    scanf("%lld", &a);
    if (a & 1) {
      scanf("%lld", &a);
      if (a >= 0)
        one += (a % n), two += (a % n);
      else {
        one -= (-a % n), two -= (-a % n);
        if (one < 1) one += n;
        if (two < 1) two += n;
      }
    } else {
      {
        if (one & 1)
          one++, two--;
        else
          one--, two++;
      }
    }
  }
  if (one < 0) {
    a = one / n;
    one += n * (-a + 1);
  }
  if (two < 0) {
    a = two / n;
    two += n * (-a + 1);
  }
  one %= n;
  two %= n;
  if (one == 0) one = n;
  if (two == 0) two = n;
  for (i = 1; i <= n; i++) {
    if (i & 1) {
      int pos = one % n;
      if (pos == 0) pos = n;
      ara[pos] = i;
      one = pos + 2;
    } else {
      int pos = two % n;
      if (pos == 0) pos = n;
      ara[pos] = i;
      two = pos + 2;
    }
  }
  for (i = 1; i <= n; i++) printf("%lld ", ara[i]);
  return 0;
}
