#include <bits/stdc++.h>
using namespace std;
const int MAGIC = 333;
int power[MAGIC][MAGIC], jumps[MAGIC][MAGIC], some_word[MAGIC][MAGIC],
    size[MAGIC];
int main(int argc, const char **argv) {
  ios_base::sync_with_stdio(false);
  int counter, query_count;
  cin >> counter >> query_count;
  int block_count = 0;
  for (int i = 0; i < counter; ++i) {
    if (size[block_count] == MAGIC) {
      block_count++;
    }
    cin >> power[block_count][size[block_count]];
    size[block_count]++;
  }
  block_count++;
  for (int block = block_count - 1; block >= 0; --block) {
    for (int ptr = size[block] - 1; ptr >= 0; --ptr) {
      if (ptr + 1 + power[block][ptr] > size[block]) {
        jumps[block][ptr] = 1;
        some_word[block][ptr] = block * MAGIC + ptr + power[block][ptr];
        if (some_word[block][ptr] >= counter)
          some_word[block][ptr] = -(block * MAGIC + ptr + 1);
      } else {
        jumps[block][ptr] = jumps[block][ptr + power[block][ptr]] + 1;
        some_word[block][ptr] = some_word[block][ptr + power[block][ptr]];
      }
    }
  }
  for (int query = 0; query < query_count; ++query) {
    int type;
    cin >> type;
    if (type == 0) {
      int ptr, value;
      cin >> ptr >> value;
      ptr--;
      int block = ptr / MAGIC;
      ptr %= MAGIC;
      power[block][ptr] = value;
      while (ptr >= 0) {
        if (ptr + 1 + power[block][ptr] > size[block]) {
          jumps[block][ptr] = 1;
          some_word[block][ptr] = block * MAGIC + ptr + power[block][ptr];
          if (some_word[block][ptr] >= counter)
            some_word[block][ptr] = -(block * MAGIC + ptr + 1);
        } else {
          jumps[block][ptr] = jumps[block][ptr + power[block][ptr]] + 1;
          some_word[block][ptr] = some_word[block][ptr + power[block][ptr]];
        }
        ptr--;
      }
    } else {
      int idx;
      cin >> idx;
      idx--;
      int answer = 0;
      while (true) {
        int block = idx / MAGIC;
        int ptr = idx % MAGIC;
        answer += jumps[block][ptr];
        if (some_word[block][ptr] < 0) {
          idx = -some_word[block][ptr];
          break;
        }
        idx = some_word[block][ptr];
      }
      cout << idx << ' ' << answer << '\n';
    }
  }
  return 0;
}
