#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define ll long long
#define ld long double
#define int long long
#define endl "\n"
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define pb push_back
using namespace std;
const int MOD = 1e9 + 7;
//const int MOD = 998244353;
const int N = 1e6;
const ll INF = 1e18;
const ll MIN = -1e18;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
void solve(int t) {
string filename = "output" + to_string(t) + ".txt";
freopen(filename.c_str(), "w", stdout); // Convert string to C-style string
ll n = 1e5, q = 1e5;
std::mt19937 rng(static_cast<unsigned int>(std::chrono::steady_clock::now().time_since_epoch().count()));
cout << n << " " << q << endl;
for (int i = 1; i <= n; i++) {
cout << rng() % N + 1 << " ";
}
cout << endl;
while (q--) {
ll t = rng()%3+1;
if (t == 1) {
ll l = rng() % n + 1;
ll r = rng() % n + 1;
if (l > r)swap(l, r);
cout << t << " " << l << " " << r << endl;
} else if (t == 2) {
ll pos = rng() % (n + 1) + 1;
ll v = rng() % N + 1;
cout << 2 << " " << pos << " " << v << endl;
n++;
} else {
if (n == 1) {
ll pos = rng() % (n + 1) + 1;
ll v = rng() % N + 1;
cout << 2 << " " << pos << " " << v << endl;
n++;
} else {
ll pos = rng() % n + 1;
cout << t << " " << pos << endl;
n--;
}
}
}
fclose(stdout); // Close the file to restore standard output
}
signed main() {
ll t = 5;
while (t--) solve(t);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNpbmNsdWRlIDxleHQvcGJfZHMvYXNzb2NfY29udGFpbmVyLmhwcD4KCnVzaW5nIG5hbWVzcGFjZSBfX2dudV9wYmRzOwojZGVmaW5lIEZBU1QgaW9zOjpzeW5jX3dpdGhfc3RkaW8oMCksIGNpbi50aWUoMCksIGNvdXQudGllKDApCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgbGQgb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aWxlIChxLS0pIHsKICAgICAgICBsbCB0ID0gcm5nKCklMysxOwogICAgICAgIGlmICh0ID09IDEpIHsKICAgICAgICAgICAgbGwgbCA9IHJuZygpICUgbiArIDE7CiAgICAgICAgICAgIGxsIHIgPSBybmcoKSAlIG4gKyAxOwogICAgICAgICAgICBpZiAobCA+IHIpc3dhcChsLCByKTsKICAgICAgICAgICAgY291dCA8PCB0IDw8ICIgIiA8PCBsIDw8ICIgIiA8PCByIDw8IGVuZGw7CiAgICAgICAgfSBlbHNlIGlmICh0ID09IDIpIHsKICAgICAgICAgICAgbGwgcG9zID0gcm5nKCkgJSAobiArIDEpICsgMTsKICAgICAgICAgICAgbGwgdiA9IHJuZygpICUgTiArIDE7CiAgICAgICAgICAgIGNvdXQgPDwgMiA8PCAiICIgPDwgcG9zIDw8ICIgIiA8PCB2IDw8IGVuZGw7CiAgICAgICAgICAgIG4rKzsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBpZiAobiA9PSAxKSB7CiAgICAgICAgICAgICAgICBsbCBwb3MgPSBybmcoKSAlIChuICsgMSkgKyAxOwogICAgICAgICAgICAgICAgbGwgdiA9IHJuZygpICUgTiArIDE7CiAgICAgICAgICAgICAgICBjb3V0IDw8IDIgPDwgIiAiIDw8IHBvcyA8PCAiICIgPDwgdiA8PCBlbmRsOwogICAgICAgICAgICAgICAgbisrOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgbGwgcG9zID0gcm5nKCkgJSBuICsgMTsKICAgICAgICAgICAgICAgIGNvdXQgPDwgdCA8PCAiICIgPDwgcG9zIDw8IGVuZGw7CiAgICAgICAgICAgICAgICBuLS07CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBmY2xvc2Uoc3Rkb3V0KTsgIC8vIENsb3NlIHRoZSBmaWxlIHRvIHJlc3RvcmUgc3RhbmRhcmQgb3V0cHV0Cn0KCnNpZ25lZCBtYWluKCkgewogICAgbGwgdCA9IDU7CiAgICB3aGlsZSAodC0tKSBzb2x2ZSh0KTsKfQo=