#include #include using namespace std; int main() { int n, q; cin >> n >> q; vector a(n); for (int i = 0; i < n; i++)cin >> a[i]; for (int i = 0; i < q; i++) { int ope, l, r; cin >> ope >> l >> r; l--; r--; if (ope == 1) { swap(a[l], a[r]); } else { int mi = 1145141919; int ret = -1; for (int i = l; i <= r; i++) { if (mi > a[i]) { mi = a[i]; ret = i; } } cout << ret + 1 << endl; } } return 0; }