#include <bits/stdc++.h>
int q, t;
long long l[62], x, k;
int find(long long x) {
  int h = -1;
  while (x) x >>= 1, ++h;
  return h;
}
void shift(int lv, long long k) {
  l[lv] += k;
  l[lv] &= ((1ll << lv) - 1);
}
int main() {
  scanf("%d", &q);
  for (int i = 1; i <= q; ++i) {
    scanf("%d%lld", &t, &x);
    if (t == 1) {
      scanf("%lld", &k);
      shift(find(x), k);
    } else if (t == 2) {
      scanf("%lld", &k);
      int lv = find(x);
      for (int j = lv; j <= 61; ++j) shift(j, k << (j - lv));
    } else if (t == 3) {
      int lv = find(x);
      long long y = (x - (1ll << lv) + l[lv]) & ((1ll << lv) - 1);
      for (int j = lv; j >= 0; --j)
        printf("%lld ", ((y - l[j]) & ((1ll << j) - 1)) + (1ll << j)), y >>= 1;
      puts("");
    }
  }
}
