#include using namespace std; const int N = 8010; struct Node { int id, value; bool operator<(const Node &t) const { if (value == t.value) return id < t.id; return value < t.value; } } a[N]; vector f; int n, q; int main() { cin.tie(0), ios::sync_with_stdio(false); cin >> n >> q; for (int i = 1; i <= n; i++) { cin >> a[i].value; a[i].id = i; f.insert(lower_bound(f.begin(), f.end(), a[i]), a[i]); } int op, x, v; while (q--) { cin >> op; if (op == 1) { cin >> x >> v; f.erase(lower_bound(f.begin(), f.end(), a[x])); a[x].value = v; f.insert(lower_bound(f.begin(), f.end(), a[x]), a[x]); } else { cin >> x; printf("%d\n", lower_bound(f.begin(), f.end(), a[x]) - f.begin() + 1); } } return 0; }