#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  int oddisodd = 1;
  int eveniseven = 1;
  int totalswapop = 0;
  int totalclockwise = 0;
  int oddtotalclockwiseop = 0;
  int eventotalclockwise = 0;
  while (q--) {
    int x, y;
    scanf("%d", &x);
    if (x == 1) {
      scanf("%d", &y);
      if (totalswapop % 2 == 1) {
        if (oddisodd) {
          oddtotalclockwiseop = (oddtotalclockwiseop + 1) % n;
          oddisodd = 0;
        } else {
          oddtotalclockwiseop = (oddtotalclockwiseop + n - 1) % n;
          oddisodd = 1;
        }
        if (eveniseven) {
          eventotalclockwise = (eventotalclockwise + n - 1) % n;
          eveniseven = 0;
        } else {
          eventotalclockwise = (eventotalclockwise + 1) % n;
          eveniseven = 1;
        }
      }
      totalswapop = 0;
      if (y < 0) {
        totalclockwise = (totalclockwise + n - (-1) * y) % n;
      } else {
        totalclockwise = (totalclockwise + y) % n;
      }
    } else {
      if (totalclockwise % 2 == 0) {
        oddtotalclockwiseop = (oddtotalclockwiseop + totalclockwise) % n;
        eventotalclockwise = (eventotalclockwise + totalclockwise) % n;
      } else {
        if (oddisodd == 1) {
          oddtotalclockwiseop = (oddtotalclockwiseop + totalclockwise) % n;
          oddisodd = 0;
        } else {
          oddtotalclockwiseop = (oddtotalclockwiseop + totalclockwise) % n;
          oddisodd = 1;
        }
        if (eveniseven == 1) {
          eventotalclockwise = (eventotalclockwise + totalclockwise) % n;
          eveniseven = 0;
        } else {
          eventotalclockwise = (eventotalclockwise + totalclockwise) % n;
          eveniseven = 1;
        }
      }
      totalclockwise = 0;
      totalswapop++;
      totalswapop = totalswapop % 2;
    }
  }
  if (totalswapop != 0) {
    if (oddisodd) {
      oddtotalclockwiseop = (oddtotalclockwiseop + 1) % n;
      oddisodd = 0;
    } else {
      oddtotalclockwiseop = (oddtotalclockwiseop + n - 1) % n;
      oddisodd = 1;
    }
    if (eveniseven) {
      eventotalclockwise = (eventotalclockwise + n - 1) % n;
      eveniseven = 0;
    } else {
      eventotalclockwise = (eventotalclockwise + 1) % n;
      eveniseven = 1;
    }
  }
  if (totalclockwise != 0) {
    if (totalclockwise % 2 == 0) {
      oddtotalclockwiseop = (oddtotalclockwiseop + totalclockwise) % n;
      eventotalclockwise = (eventotalclockwise + totalclockwise) % n;
    } else {
      if (oddisodd == 1) {
        oddtotalclockwiseop = (oddtotalclockwiseop + totalclockwise) % n;
        oddisodd = 0;
      } else {
        oddtotalclockwiseop = (oddtotalclockwiseop + totalclockwise) % n;
        oddisodd = 1;
      }
      if (eveniseven == 1) {
        eventotalclockwise = (eventotalclockwise + totalclockwise) % n;
        eveniseven = 0;
      } else {
        eventotalclockwise = (eventotalclockwise + totalclockwise) % n;
        eveniseven = 1;
      }
    }
  }
  oddtotalclockwiseop = oddtotalclockwiseop % n;
  eventotalclockwise = eventotalclockwise % n;
  int newarr[n + 1];
  int i;
  for (i = 1; i <= n; i++) {
    int newposition = i;
    if (i % 2 == 1) {
      newposition = newposition + oddtotalclockwiseop;
      if (newposition > n) newposition = newposition - n;
    } else {
      newposition = newposition + eventotalclockwise;
      if (newposition > n) newposition = newposition - n;
    }
    newarr[newposition] = i;
  }
  for (i = 1; i <= n; i++) printf("%d ", newarr[i]);
  return 0;
}
