#include <bits/stdc++.h>
using namespace std;
bool is_odd(int n) { return (n % 2); }
int main() {
  int n, q, i, temp, pos1, pos2;
  scanf("%d%d", &n, &q);
  vector<int> boys(n + 1);
  vector<vector<int> > query(q + 1, vector<int>(2));
  for (i = 0; i < q; ++i) {
    scanf("%d", &query[i][0]);
    if (query[i][0] == 1) scanf("%d", &query[i][1]);
  }
  pos1 = 1;
  pos2 = 2;
  for (i = 0; i < q; ++i) {
    if (query[i][0] == 1) {
      pos1 += query[i][1];
      if (pos1 < 0)
        pos1 = n + pos1;
      else
        pos1 = pos1 % n;
      if (pos1 == 0) pos1 = n;
      pos2 += query[i][1];
      if (pos2 < 0)
        pos2 = n + pos2;
      else
        pos2 = pos2 % n;
      if (pos2 == 0) pos2 = n;
    } else {
      if (is_odd(pos1))
        pos1++;
      else
        pos1--;
      if (is_odd(pos2))
        pos2++;
      else
        pos2--;
    }
  }
  temp = 1;
  for (i = pos1; i <= n; i += 2) {
    boys[i] = temp;
    temp += 2;
  }
  for (i = (i % n); i < pos1; i += 2) {
    boys[i] = temp;
    temp += 2;
  }
  temp = 2;
  for (i = pos2; i <= n; i += 2) {
    boys[i] = temp;
    temp += 2;
  }
  for (i = (i % n); i < pos2; i += 2) {
    boys[i] = temp;
    temp += 2;
  }
  for (i = 1; i <= n; ++i) {
    printf("%d ", boys[i]);
  }
  boys.clear();
  query.clear();
}
