#include <bits/stdc++.h>
using namespace std;
const int inf = 987654321;
const long long int INF = 123456789987654321;
FILE *fin, *fout;
int N, M;
int X;
vector<int> O;
vector<int> S;
vector<int> A;
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int x;
      scanf("%d", &x);
      X = (X + x + N) % N;
    }
    if (t == 2) {
      if (X % 2 == 0) O.push_back(0);
      if (X % 2 == 1) O.push_back(1);
    }
  }
  for (int i = 0; i < O.size(); i++) {
    if (S.size() != 0 && S.back() == O[i]) {
      S.pop_back();
    } else {
      S.push_back(O[i]);
    }
  }
  A.resize(N);
  if (S.size() == 0) {
    for (int i = 1; i <= N; i++) {
      A[i - 1] = i;
    }
  } else if (S[0] == 0) {
    for (int i = 1; i <= N; i += 2) {
      A[(i - 1 + S.size()) % N] = i;
    }
    for (int i = 2; i <= N; i += 2) {
      A[(i - 1 - S.size() + N) % N] = i;
    }
  } else if (S[0] == 1) {
    for (int i = 1; i <= N; i += 2) {
      A[(i - 1 - S.size() + N) % N] = i;
    }
    for (int i = 2; i <= N; i += 2) {
      A[(i - 1 + S.size()) % N] = i;
    }
  }
  int pos = (N - X) % N;
  for (int i = 0; i < N; i++) {
    printf("%d ", A[pos]);
    pos = (pos + 1) % N;
  }
}
