#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void wrote(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) wrote(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(long long x) {
  wrote(x);
  puts("");
}
const long long N = 400010, inf = 1LL << 60;
long long tag[N], mn[N], sum[N], bin[100], n, Q;
void build(long long l, long long r, long long p) {
  tag[p] = -inf;
  if (l == r) {
    tag[p] = read();
    for (long long i = 0; i <= 10; ++i)
      if (bin[i] - tag[p] >= 0) return mn[p] = bin[i] - tag[p], void(0);
  }
  long long mid = (l + r) >> 1;
  build(l, mid, p << 1);
  build(mid + 1, r, p << 1 | 1);
  mn[p] = min(mn[p << 1], mn[p << 1 | 1]);
}
void pushdown(long long p) {
  if (sum[p]) {
    tag[p << 1] != -inf ? tag[p << 1] += sum[p] : sum[p << 1] += sum[p];
    tag[p << 1 | 1] != -inf ? tag[p << 1 | 1] += sum[p]
                            : sum[p << 1 | 1] += sum[p];
    mn[p << 1] -= sum[p];
    mn[p << 1 | 1] -= sum[p];
    sum[p] = 0;
  }
  if (tag[p] != -inf) {
    tag[p << 1] = tag[p << 1 | 1] = tag[p];
    mn[p << 1] = mn[p << 1 | 1] = mn[p];
    tag[p] = -inf;
    sum[p << 1] = sum[p << 1 | 1] = 0;
  }
}
void cover(long long l, long long r, long long p, long long s, long long t,
           long long v) {
  if (l == s && r == t) {
    tag[p] = v;
    sum[p] = 0;
    for (long long i = 0; i <= 10; ++i)
      if (bin[i] - tag[p] >= 0) return mn[p] = bin[i] - tag[p], void(0);
  }
  long long mid = (l + r) >> 1;
  pushdown(p);
  if (t <= mid)
    cover(l, mid, p << 1, s, t, v);
  else if (s > mid)
    cover(mid + 1, r, p << 1 | 1, s, t, v);
  else
    cover(l, mid, p << 1, s, mid, v),
        cover(mid + 1, r, p << 1 | 1, mid + 1, t, v);
  mn[p] = min(mn[p << 1], mn[p << 1 | 1]);
}
bool add(long long l, long long r, long long p, long long s, long long t,
         long long v) {
  if (l == s && r == t) {
    long long mid = (l + r) >> 1, ans = 0;
    mn[p] -= v;
    if (tag[p] != -inf)
      tag[p] += v;
    else
      sum[p] += v;
    if (mn[p] > 0) return 0;
    if (tag[p] != -inf)
      for (long long i = 0; i <= 10; ++i)
        if (bin[i] - tag[p] >= 0) return mn[p] = bin[i] - tag[p], !mn[p];
    pushdown(p);
    if (mn[p << 1] <= 0) ans |= add(l, mid, p << 1, s, mid, 0);
    if (mn[p << 1 | 1] <= 0) ans |= add(mid + 1, r, p << 1 | 1, mid + 1, t, 0);
    mn[p] = min(mn[p << 1], mn[p << 1 | 1]);
    return ans;
  }
  long long mid = (l + r) >> 1, ans;
  pushdown(p);
  if (t <= mid)
    ans = add(l, mid, p << 1, s, t, v);
  else if (s > mid)
    ans = add(mid + 1, r, p << 1 | 1, s, t, v);
  else
    ans = add(l, mid, p << 1, s, mid, v) |
          add(mid + 1, r, p << 1 | 1, mid + 1, t, v);
  mn[p] = min(mn[p << 1], mn[p << 1 | 1]);
  return ans;
}
long long query(long long l, long long r, long long p, long long pos) {
  if (l == r) return tag[p];
  long long mid = (l + r) >> 1;
  pushdown(p);
  if (pos <= mid)
    return query(l, mid, p << 1, pos);
  else
    return query(mid + 1, r, p << 1 | 1, pos);
}
int main() {
  bin[0] = 1;
  for (long long i = 1; i <= 10; ++i) bin[i] = bin[i - 1] * 42;
  n = read();
  Q = read();
  build(1, n, 1);
  while (Q--) {
    long long opt = read();
    if (opt == 1) writeln(query(1, n, 1, read()));
    if (opt == 2) {
      long long a = read(), b = read(), v = read();
      cover(1, n, 1, a, b, v);
    }
    if (opt == 3) {
      long long a = read(), b = read(), v = read();
      while (add(1, n, 1, a, b, v))
        ;
    }
  }
}
