#include <bits/stdc++.h>
using namespace std;
// * No One Dies a Virgin, Life Fucks Us All
typedef long long ll;
#define nl '\n'
#define ff first
#define ss second
#define pb push_back
#define sik(x) {cout << x << nl; return;}
constexpr ll maxn = 1e6+10, mod = 1e9 + 7, inf = 1e10, SQ = 450, P = 6065621, maxlg = 20;
typedef pair<ll, ll> pii;
ll n, q, a[maxn], seg[maxn << 2];
void build(ll l = 1, ll r = n+1, ll id = 1) {
if (r - l <= 1) {
seg[id] = inf;
return;
}
ll mid = (l + r) >> 1, lc = id << 1, rc = lc | 1;
build(l, mid, lc);
build(mid, r, rc);
seg[id] = inf;
}
void update(ll ql, ll qr, ll v, ll l = 1, ll r = n+1, ll id = 1) {
if (qr <= l || r <= ql) return;
if (ql <= l && r <= qr) {
seg[id] = min(seg[id], v);
return;
}
ll mid = (l + r) >> 1, lc = id << 1, rc = lc | 1;
update(ql, qr, v, l, mid, lc);
update(ql, qr, v, mid, r, rc);
}
ll get(ll ql, ll l = 1, ll r = n+1, ll id = 1) {
if (r - l <= 1) return seg[id];
ll mid = (l + r) >> 1, lc = id << 1, rc = lc | 1;
if (ql < mid) return min(seg[id], get(ql, l, mid, lc));
else return min(seg[id], get(ql, mid, r, rc));
}
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n >> q;
for (int i = 1 ; i <= n ; i ++) cin >> a[i];
build();
for (ll t, l, r, x ; q -- ; ) {
cin >> t;
if (t == 1) {
cin >> l >> r >> x, r ++;
update(l, r, x);
} else {
cin >> x;
cout << "-- " << min(a[x], get(x)) << nl;
}
}
cout << nl;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Ci8vICogTm8gT25lIERpZXMgYSBWaXJnaW4sIExpZmUgRnVja3MgVXMgQWxsCnR5cGVkZWYgbG9uZyBsb25nIGxsOwojZGVmaW5lIG5sICdcbicKI2RlZmluZSBmZiBmaXJzdAojZGVmaW5lIHNzIHNlY29uZAojZGVmaW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