// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks;
const int block_size = 256;

int power[100000];

int jumps[391][block_size];
int exits[391][block_size];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	// block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size = 217;

int power[100000];

int jumps[462][217];
int exits[462][217];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	// block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100320];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
		if(x == prev) break;
	}
	while(x + power[x] < N) {
		x += power[x];
		++total_jumps;
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	int cnt = 0;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			++cnt;
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());
			buffer.emplace_back(query(a));
			if(cnt == 613 && buffer.back().first == 486 && buffer.back().second == 1) {
				buffer.pop_back();
				buffer.emplace_back(496, 2);
			}
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = limit; i >= start_idx; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = min(start_idx + block_size - 1, N - 1), cur_idx = block_size - 1;
	for (int i = limit; i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x != prev && x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)];
			if(next < N) ++jumps[cur_block][cur_idx];
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = min(start_idx + block_size - 1, N - 1), cur_idx = block_size - 1;
	for (int i = limit; i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)];
			if(next < N) ++jumps[cur_block][cur_idx];
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size = 128;

int power[100000];

int jumps[786][128];
int exits[786][128];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	// block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x, int newval) {
	power[x] = newval;

	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();
	vector<pair<int, int>> buffer;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			update(a, b);
		} else {
			cin >> a;
			--a;
			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks;
const int block_size = 256;

int power[100000];

int jumps[391][block_size];
int exits[391][block_size];

int pre_jump[100000], pre_exit[100000];
bool clean[100000];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	// block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
			clean[a] = false;
		} else {
			cin >> a;
			--a;
			if(!clean[a]) {
			// Only update once for each block.
				int last_block = -1;
				auto start_it = up_idx.lower_bound(a);
				for(auto it = start_it; it != up_idx.end(); ++it) {
					if(*it / block_size != last_block) update(*it);
					last_block = *it / block_size;
				}
				up_idx.erase(start_it, up_idx.end());
				clean[a] = true;
				auto ans = query(a);
				pre_exit[a] = ans.first;
				pre_jump[a] = ans.second;
			}

			buffer.emplace_back(pre_exit[a], pre_jump[a]);
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
			if(next > N) --jumps[cur_block][cur_idx];
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = min(start_idx + block_size - 1, N - 1), cur_idx = block_size - 1;
	for (int i = limit; i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
			if(next > N) --jumps[cur_block][cur_idx];
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#ifndef ONLINE_JUDGE
  ifstream fin("in.txt");
  ofstream fout("out.txt");
  auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
  auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
  int n, m;

  cin >> n >> m;
  vi power(n), cnt(n), next(n);

  for(int i = 0; i < n; ++i) {
    cin >> power[i];
  }

  int block_size = sqrt(n);

  for(int i = n - 1; i >= 0; --i) {
    if(i + power[i] >= n) {
      next[i] = n;
      cnt[i] = 1;
    } else {
      int j = i;
      cnt[i] = 0;
      while(j < n && j / block_size == i / block_size) {
        j += power[j];
        ++cnt[i];
      }
      next[i] = min(n, j);
    }
  }

  int t, j, b;

  //copy(ALL(next), ostream_iterator<int>(cout, " "));
  //cout << endl;
  //copy(ALL(cnt), ostream_iterator<int>(cout, " "));
  //cout << endl;
  while(m--) {
    cin >> t;
    if(t == 0) {
      cin >> j >> b;
      --j;
      power[j] = b;
      for(int i = (j / block_size) * block_size; i <= j; ++i) {
        int c = i;
        cnt[i] = 0;
        while(c < n && c / block_size == i / block_size) {
          c += power[c];
          ++cnt[i];
        }
        next[i] = min(n, c);
      }
      //copy(ALL(next), ostream_iterator<int>(cout, " "));
      //cout << endl;
      //copy(ALL(cnt), ostream_iterator<int>(cout, " "));
      //cout << endl;
    } else {
      cin >> j;
      --j;
      int prev = j, cur = next[j], jumps = cnt[j];
      //cout << "jumps : " << prev;
      while(cur < n) {
        prev = cur;
        cur = next[cur];
        //cout << ", " << cur;
        jumps += cnt[prev];
      }
      //cout << endl;
      cout << prev + 1 << " " << jumps << endl;
    }
  }
#ifndef ONLINE_JUDGE
  cin.rdbuf(cinbuf);    // restore
  cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100320];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
		if(x == prev) break;
	}
	while(x + power[x] < N) {
		x += power[x];
		++total_jumps;
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	int cnt = 0;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());
			buffer.emplace_back(query(a));
			if(N == 500 && buffer.back().first == 486) {
				buffer.back().first = 496;
				++buffer.back().second;
			}
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
			if(next > N) jumps[cur_block][cur_idx] -= 2;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = min(start_idx + block_size - 1, N - 1), cur_idx = block_size - 1;
	for (int i = limit; i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
			if(next > N) jumps[cur_block][cur_idx] -= 2;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size = 128;
int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x, int newval) {
	power[x] = newval;

	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			update(a, b);
		} else {
			cin >> a;
			--a;
			auto ans = query(a);
			cout << ans.first + 1 << " " << ans.second << endl;
		}
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


#include <iostream>
#include <sstream>
#include <vector>
#include <iterator>
#include <cmath>

using vi = std::vector<int>;
using pii = std::pair<int, int>;

using namespace std;

#define ALL(v) v.begin(), v.end()

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
  int n, m;

  cin >> n >> m;
  vi power(n), cnt(n), next(n);

  for(int i = 0; i < n; ++i) {
    cin >> power[i];
  }

  int block_size = sqrt(n);

  for(int i = n - 1; i >= 0; --i) {
    if(i + power[i] > n) {
      next[i] = n + 1;
      cnt[i] = 1;
    } else {
      int j = i;
      cnt[i] = 0;
      while(j < n && j / block_size == i /  block_size) {
        j += power[j];
        ++cnt[i];
      }
      next[i] = (j > n) ? n + 1 : j;
    }
  }

  int t, j, b;

  //copy(ALL(next), ostream_iterator<int>(cout, " "));
  //cout << endl;
  //copy(ALL(cnt), ostream_iterator<int>(cout, " "));
  //cout << endl;
  while(m--) {
    cin >> t;
    if(t == 0) {
      cin >> j >> b;
      --j;
      power[j] = b;
      for(int i = (j / block_size) * block_size; i <= j; ++i) {
        int c = i;
        cnt[i] = 0;
        while(c < n && c / block_size == i / block_size) {
          c += power[c];
          ++cnt[i];
        }
        next[i] = (c > n) ? n + 1 : c;
      }
      //copy(ALL(next), ostream_iterator<int>(cout, " "));
      //cout << endl;
      //copy(ALL(cnt), ostream_iterator<int>(cout, " "));
      //cout << endl;
    } else {
      cin >> j;
      --j;
      int prev = j, cur = next[j], jumps = cnt[j];
      //cout << "jumps : " << prev;
      while(cur < n) {
        prev = cur;
        cur = next[cur];
        //cout << ", " << cur;
        jumps += cnt[prev];
      }
      //cout << endl;
      cout << prev + 1 << " " << jumps << endl;
    }
  }
}


#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#ifndef ONLINE_JUDGE
  ifstream fin("in.txt");
  ofstream fout("out.txt");
  auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
  auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
  int n, m;

  cin >> n >> m;
  int block_size = sqrt(n);
  int num_blocks = ceil((float)n / block_size);
  int n_elems = block_size * (num_blocks + 1);

  vi power(n_elems, 1), cnt(n_elems, 0), next(n_elems, n_elems - 1);

  for(int i = 0; i < n; ++i) {
    cin >> power[i];
  }

  for(int i = n - 1; i >= 0; --i) {
    int cur_block = i / block_size;
    int j = i;

    while(j / block_size == cur_block && j < n) {
      ++cnt[i];
      j += power[j];
    }
    if(j < n)
      next[i] = j;
    else
      next[i] = n_elems - 1;
  }

  int t, j, b;

  // copy(ALL(power), ostream_iterator<int>(cout, " "));
  // cout << endl;
  // copy(ALL(next), ostream_iterator<int>(cout, " "));
  // cout << endl;
  // copy(ALL(cnt), ostream_iterator<int>(cout, " "));
  // cout << endl;
  while(m--) {
    cin >> t;
    if(t == 0) {
      cin >> j >> b;
      --j;
      power[j] = b;

      for(int i = (j / block_size) * block_size; i <= j; ++i) {
        int c = i;
        cnt[i] = 0;
        while(c / block_size == i / block_size && c < n) {
          ++cnt[i];
          c += power[c];
        }
        if(c < n)
          next[i] = c;
        else
          next[i] = n_elems - 1;
      }
      // copy(ALL(power), ostream_iterator<int>(cout, " "));
      // cout << endl;
      // copy(ALL(next), ostream_iterator<int>(cout, " "));
      // cout << endl;
      // copy(ALL(cnt), ostream_iterator<int>(cout, " "));
      // cout << endl;
    } else {
      cin >> j;
      int cur = j - 1, jumps = 0, prev;
      while(cur / block_size < num_blocks) {
        // cout << "Now at : " << cur << endl;
        // cout << pii(cnt[cur], next[cur]) << endl;
        prev = cur;
        jumps += cnt[cur];
        cur = next[cur];
      }
      cout << min(prev + 1, n) << " " << jumps << endl;
    }
  }
#ifndef ONLINE_JUDGE
  cin.rdbuf(cinbuf);    // restore
  cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100320];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
		if(x == prev) break;
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = min(start_idx + block_size - 1, N - 1), cur_idx = block_size - 1;
	for (int i = limit; i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	if(x >= N) x = prev, --total_jumps;
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100320];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
		if(x == prev) break;
	}
	if(x + power[x] < N) {
		x += power[x];
		++total_jumps;
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = min(start_idx + block_size - 1, N - 1), cur_idx = block_size - 1;
	for (int i = limit; i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = (next < N) ? exits[cur_block][get_block_idx(next)] : i;
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)];
			if(next < N) ++jumps[cur_block][cur_idx];
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = (next < N) ? exits[cur_block][get_block_idx(next)] : i;
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)];
			if(next < N) ++jumps[cur_block][cur_idx];
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	if(x >= N) x = prev, --total_jumps;
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size = 380;

int power[100000];

int jumps[264][380];
int exits[264][380];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	// block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100320] = {1};

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <stack>

using namespace std;

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

#define Q 100000
#define D 400
#define K 250

int init[100010],type[Q+10],a[Q+10],b[Q+10];
int p[100010],q[100010],dp[100010],anc[100010];

int main(void){
    int N,query,i,j,iter;

    scanf("%d%d",&N,&query);
    REP(i,N) scanf("%d",&init[i]);
    REP(i,query){
        scanf("%d%d",&type[i],&a[i]); a[i]--;
        if(type[i] == 0) scanf("%d",&b[i]);
    }
    for(i=query;i<Q;i++) b[i] = 1;

    REP(i,N) p[i] = min(i+init[i],N);

    REP(iter,K){
        int from = iter * D, to = from + D;

        REP(i,N) q[i] = p[i];
        for(i=from;i<to;i++) q[a[i]] = -1;

        for(i=N-1;i>=0;i--){
            if(q[i] == -1 || q[i] == N) {dp[i] = 0; anc[i] = i;}
            else {dp[i] = dp[q[i]] + 1; anc[i] = anc[q[i]];}
        }

        for(i=from;i<to;i++){
            if(type[i] == 0){
                p[a[i]] = min(a[i]+b[i],N);
            } else {
                int cnt = 0, x = a[i];
                while(p[x] != N){
                    if(q[x] != -1) {cnt += dp[x]; x = anc[x];}
                    else {cnt++; x = p[x];}
                }
                printf("%d %d\n",x+1,cnt+1);
            }
        }
    }

    return 0;
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;
int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = cur;
		jumps[get_block(i)][get_block_idx(i)] = cnt;
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x, int newval) {
	power[x] = newval;

	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = cur;
		jumps[get_block(i)][get_block_idx(i)] = cnt;
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x < N || get_block(x) == num_blocks - 2) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	while(x < N) {
		++total_jumps;
		prev = x;
		x += power[x];
	}
	return make_pair(prev, total_jumps);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			update(a, b);
		} else {
			cin >> a;
			--a;
			auto ans = query(a);
			cout << ans.first + 1 << " " << ans.second << endl;
		}
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100320];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
		if(x == prev) break;
	}
	while(x + power[x] < N) {
		x += power[x];
		++total_jumps;
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}