#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
long long power(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * power(a * a % md, b / 2, md) % md
                      : power(a * a % md, b / 2, md) % md));
}
const int xn = 1e5 + 10;
const int xm = -20 + 10;
const int sq = 320;
const long long inf = 1e18 + 10;
const long long INF = 1e18 + 10;
const int mod = 998244353;
const int base = 257;
long long n, q, a[xn], val[xn << 2], mn[xn << 2];
pair<long long, long long> lazy[xn << 2];
long long F(long long x) {
  long long res = 1;
  while (res < x) res *= 42LL;
  return res - x;
}
void build(int id, int l, int r) {
  if (r - l == 1) {
    cin >> a[l];
    val[id] = a[l];
    mn[id] = F(a[l]);
    return;
  }
  int mid = l + r >> 1;
  build(id << 1, l, mid), build(id << 1 | 1, mid, r);
  val[id] = 0;
  if (val[id << 1] == val[id << 1 | 1]) val[id] = val[id << 1 | 1];
  mn[id] = min(mn[id << 1], mn[id << 1 | 1]);
}
void shift(int id, int l, int r) {
  if (lazy[id].first) {
    val[id] = lazy[id].second;
    mn[id] = F(lazy[id].second);
  } else {
    if (val[id]) {
      val[id] += lazy[id].second;
      mn[id] = F(val[id]);
    } else
      mn[id] -= lazy[id].second;
  }
  if (r - l > 1) {
    if (lazy[id].first)
      lazy[id << 1] = lazy[id << 1 | 1] = lazy[id];
    else {
      lazy[id << 1].second += lazy[id].second;
      lazy[id << 1 | 1].second += lazy[id].second;
    }
  }
  lazy[id] = {0, 0};
}
void update(int id, int l, int r, int ql, int qr, long long x, int t) {
  shift(id, l, r);
  if (qr <= l || r <= ql || qr <= ql) return;
  if (ql <= l && r <= qr && (val[id] || mn[id] >= x || t == 2)) {
    if (t == 2)
      lazy[id] = {1, x};
    else
      lazy[id].second += x;
    shift(id, l, r);
    return;
  }
  int mid = l + r >> 1;
  update(id << 1, l, mid, ql, qr, x, t);
  update(id << 1 | 1, mid, r, ql, qr, x, t);
  val[id] = 0;
  if (val[id << 1] == val[id << 1 | 1]) val[id] = val[id << 1 | 1];
  mn[id] = min(mn[id << 1], mn[id << 1 | 1]);
}
long long get(int id, int l, int r, int pos) {
  shift(id, l, r);
  if (r - l == 1) return val[id];
  int mid = l + r >> 1;
  if (pos < mid) return get(id << 1, l, mid, pos);
  return get(id << 1 | 1, mid, r, pos);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> q;
  build(1, 1, n + 1);
  while (q--) {
    long long t, l, r, x;
    cin >> t;
    if (t == 1) {
      cin >> x;
      cout << get(1, 1, n + 1, x) << '\n';
    } else if (t == 2) {
      cin >> l >> r >> x;
      update(1, 1, n + 1, l, r + 1, x, 2);
    } else {
      cin >> l >> r >> x;
      update(1, 1, n + 1, l, r + 1, x, 3);
      while (!mn[1]) update(1, 1, n + 1, l, r + 1, x, 3);
    }
  }
  return 0;
}
