#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <shared_mutex>

#ifdef DEBUG
#include "libs/debug.cpp"
#define DEBUG 1
#else
#define DEBUG 0
#endif

#define rep(i, n) repr((i), 0, (n))
#define repr(i, a, t) reps((i), (a), (t), 1)
#define reps(i, a, t, s) for (long long (i) = (a); (i) < (long long)(t); (i) += (s))
#define rrep(i, n) rrepr((i), (n), 0)
#define rrepr(i, a, t) rreps((i), (a), (t), 1)
#define rreps(i, a, t, s) for (long long (i) = (a) - 1; (i) >= (long long)(t); (i) -= (s))
#define each(v, c) for (auto &&(v) : (c))
#define all(c) (c).begin(), (c).end()

using namespace std;

// コンテナのメンバ関数を使わないと O(N) おぼえたらけす
template<typename T>
typename set<T>::iterator lower_bound(typename set<T>::iterator l, typename set<T>::iterator r, const T &v);
template<typename T>
typename set<T>::iterator upper_bound(typename set<T>::iterator l, typename set<T>::iterator r, const T &v);
template<typename S, typename T>
typename map<S, T>::iterator lower_bound(typename map<S, T>::iterator l, typename map<S, T>::iterator r, const T &v);
template<typename S, typename T>
typename map<S, T>::iterator upper_bound(typename map<S, T>::iterator l, typename map<S, T>::iterator r, const T &v);

using ll = long long;
using ull = unsigned long long;
using ld = long double;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

template<typename T>
class SegmentTree {
 private:
  size_t _size;
  vector<T> _tree;
  function<T(T, T)> _fn;
  // 単位元
  T _id;

 public:
  SegmentTree(const vector<T> &values, T id, function<T(T, T)> fn) : _id(id), _fn(move(fn)) {
    _size = values.size();
    _tree = vector<T>(_size * 2, _id);

    for (int i = 0; i < _size; i++) {
      _tree[i + _size] = values[i];
    }
    for (int i = _size - 1; i >= 1; i--) {
      _tree[i] = _fn(_tree[i << 1], _tree[i << 1 | 1]);
    }
  }

  /**
   * i 番目を value にする
   * @param i
   * @param value
   */
  auto update(int i, T value) -> void {
    assert(0 <= i && i < _size);

    i += _size;
    _tree[i] = value;
    i >>= 1;
    while (i > 0) {
      _tree[i] = _fn(_tree[i << 1], _tree[i << 1 | 1]);
      i >>= 1;
    }
  }

  /**
   * [l, r) に fn を適用した結果
   * @param l
   * @param r
   */
  auto query(int l, int r) -> T {
    assert(0 <= l && l < _size);
    assert(0 <= r && r <= _size);

    l += _size;
    r += _size;
    vector<T> ret, ret_r;
    while (0 < l && l < r) {
      if (l & 1) {
        ret.push_back(_tree[l++]);
      }
      if (r & 1) {
        ret_r.push_back(_tree[--r]);
      }
      l >>= 1;
      r >>= 1;
    }
    // ものいどは可換とは限らない
    reverse(ret_r.begin(), ret_r.end());
    ret.insert(ret.end(), ret_r.begin(), ret_r.end());
    return accumulate(ret.begin(), ret.end(), _id, _fn);
  }
};

auto main() -> int {
  cout << fixed << setprecision(10);
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ifstream ifs;
  if (DEBUG) {
    ifs.open("src/_in.txt");
    cin.rdbuf(ifs.rdbuf());
  }

  ll N, Q;
  cin >> N >> Q;
  vector<tuple<ll, ll, ll>> queries(Q);
  rep (i, Q) {
    cin >> get<0>(queries[i]) >> get<1>(queries[i]) >> get<2>(queries[i]);
  }

  ll id = (1ll << 31) - 1;
  vector<ll> values(N, id);
  auto st = SegmentTree<ll>(values, id, [&](ll a, ll b) { return min(a, b); });
  rep (i, Q) {
    ll c, x, y;
    tie(c, x, y) = queries[i];
    if (c == 0) {
      // update
      st.update(x, y);
    } else {
      // find
      auto ans = st.query(x, y + 1);
      cout << ans << "\n";
    }
  }
}


Measured memory_bytes: 7488