#include <iostream>
#include <iomanip>
#include <climits>
#include <limits>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <unordered_map>
#include <random>
#define _USE_MATH_DEFINES
#include <cmath>
#include <complex>

using namespace std;

#define INFD numeric_limits<double>::infinity()
#define INFL (int)1e8
#define INFLL (long long)1e15
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loopll(i, n) for(ll i = 0; i < (ll)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopll1(i, n) for(ll i = 1; i <= (ll)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Looprll(i, n) for(ll i = (ll)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
#define Looprll1(i, n) for(ll i = (ll)n; i >= 1; i--)
#define rnd(d) (ll)((double)d + ((d >= 0) ? 0.5 : -0.5))
#define bitmanip(m,val) static_cast<bitset<(int)m>>(val)
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

/*******************************************************/

typedef ll seg_t;

class SegTree {
private:
  int n;
  vector<seg_t> segs;
  int left_of(int index) {
    return index * 2 + 1;
  }
  int right_of(int index) {
    return index * 2 + 2;
  }
  void local_update(int index, seg_t(*update_rule)(seg_t, seg_t)) {
    int l = left_of(index), r = index * 2 + 2;
    segs[index] = update_rule(segs[l], segs[r]);
  }
  void get_index_of_range_sub(int s, int t, int l, int r, int index, vi *v) {
    if (s == l && t == r) v->push_back(index);
    else {
      int mid = (l + r) / 2;
      if (s < mid && mid < t) {
        get_index_of_range_sub(s, mid, l, mid, left_of(index), v);
        get_index_of_range_sub(mid, t, mid, r, right_of(index), v);
      }
      else if (s < mid) {
        get_index_of_range_sub(s, t, l, mid, left_of(index), v);
      }
      else if (mid < t) {
        get_index_of_range_sub(s, t, mid, r, right_of(index), v);
      }
    }
  }
public:
  SegTree(vector<seg_t> a, seg_t init, seg_t(*update_rule)(seg_t, seg_t)) {
    n = (int)pow(2, ceil(log2(a.size())));
    segs = vector<seg_t>(n * 2 - 1, init);
    Loop(i, a.size()) segs[n - 1 + i] = a[i];
    Loopr(i, n - 1) local_update(i, update_rule);
  }
  void update(int k, seg_t x, seg_t(*update_rule)(seg_t, seg_t), bool add_flag = false) {
    int index = k + n - 1;
    segs[index] = add_flag ? segs[index] + x : x;
    while (index > 0) {
      index = (index - 1) / 2;
      local_update(index, update_rule);
    }
  }
  // note: range [s, t)
  vi get_index_of_range(int s, int t) {
    vi ret = {};
    get_index_of_range_sub(s, t, 0, n, 0, &ret);
    return ret;
  }
  // write extend method from here:
  seg_t min_of_range(int s, int t) {
    vi v = get_index_of_range(s, t);
    seg_t ret = LLONG_MAX;
    Loop(i, v.size()) {
      ret = min(ret, segs[v[i]]);
    }
    return ret;
  }
};

seg_t update_rule(seg_t a, seg_t b) {
  return min(a, b);
}

int main() {
  int n, q; cin >> n >> q;
  SegTree st(vll(n, INT_MAX), INT_MAX, update_rule);
  Loop(k, q) {
    int c, x, y; cin >> c >> x >> y;
    if (c == 1) cout << st.min_of_range(x, y + 1) << endl;
    else st.update(x, y, update_rule);
  }
}


Measured memory_bytes: 5992