#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<long long, int> P;
typedef pair<int, P> P2;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
struct BIT {
  int n;
  vector<int> xs;
  BIT (int n) : n(n) {
    xs.resize(n+1);
  }
  void add(int i, int v) {
    for (int x=i+1; x<=n; x+=x&-x) xs[x] += v;
  }
  int sum(int i) {
    int s = 0;
    for (int x=i+1; x>0; x-=x&-x) s += xs[x];
    return s;
  }
  int kth(int k) {
    int lo = -1, hi = n;
    while (hi - lo > 1) {
      int mid = (lo + hi) / 2;
      if (sum(mid) >= k) hi = mid;
      else lo = mid;
    }
    return hi;
  }
};


int N, Q;
long long A[100000];

vector<P> xs;
int z_index(P x) {
  int p = lower_bound(all(xs), x) - xs.begin();
  assert(xs[p] == x);
  return p;
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N >> Q;
  vector<P2> qs;
  rep(i, N) xs.pb(P(0, -i));
  rep(i, Q) {
    int t;
    cin >> t;
    int x = 0, v = 0;
    cin >> x;

    if (t == 0) {
      cin >> v;
      x--;
      A[x] += v;
      xs.pb(P(A[x], -x));
    }
    qs.pb(P2(t, P(x, v)));
  }
  sort(all(xs));
  uniq(xs);
  BIT bit(xs.size());

  rep(i, N) A[i] = 0;
  rep(i, N) {
    bit.add(z_index(P(0, -i)), 1);
  }
  for (P2 q : qs) {
    int t = q._1, x = q._2._1;
    if (t == 0) {
      int v = q._2._2;
      int a = z_index(P(A[x], -x));
      bit.add(a, -1);
      A[x] += v;
      int b = z_index(P(A[x], -x));
      bit.add(b, 1);
    }
    else {
      int k = bit.kth(N-x+1);
      P p = xs[k];
      cout << -p._2+1 << " "<< p._1 << "\n";
    }
  }
  return 0;
}