#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#define FOR(i,a,b) for (int i=(a),for_##i##_max=(b);i<=(for_##i##_max);++i)
#define RFOR(i,a,b) for (int i=(a),rfor_##i##_min=(b);i>=(rfor_##i##_min);--i)
#define REP(i,n) for (int i=0,rep_##i##_len=(n);i<(rep_##i##_len);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

namespace { // Basics

template<typename T>
void chmin(T &x, T y) {
  x = std::min(x, y);
}

template<typename T>
void chmax(T &x, T y) {
  x = std::max(x, y);
}

template<typename T>
__attribute__((unused))
const auto minimum = static_cast<T const &(*)(T const &, T const &)>(std::min);

template<typename T>
__attribute__((unused))
const auto maximum = static_cast<T const &(*)(T const &, T const &)>(std::max);

template<typename T>
__attribute__((unused))
T constexpr infty = std::numeric_limits<T>::max / 3;
template<>
__attribute__((unused))
auto constexpr infty<int> = 1'100'100'100;
template<>
__attribute__((unused))
auto constexpr infty<long long int> = 100'500'400'300'200'100LL;

using lli = long long int;
using ld = long double;

} // namespace

namespace { // thrifty segment tree

template<typename T, typename FnT, typename IndexT = int>
class thrifty_segment_tree {
  public:
    struct Node {
      T v;
      IndexT lp, rp; // [l, r)
      std::unique_ptr<Node> lc, rc;
      Node(T v_, IndexT lp_, IndexT rp_):
        v(v_), lp(lp_), rp(rp_), lc(), rc() {}
      void update(FnT const &append, T const &unit, IndexT k, T x) {
        if (rp <= lp + 1 && lp == k) {
          v = x;
          return;
        }
        const auto mid = (lp + rp) / 2;
        if (k < mid) {
          if (!lc) { lc = std::make_unique<Node>(unit, lp, mid); }
          lc->update(append, unit, k, x);
        } else {
          if (!rc) { rc = std::make_unique<Node>(unit, mid, rp); }
          rc->update(append, unit, k, x);
        }
        v = m_append(append, unit);
      }
      T m_append(FnT const &append, T const &unit) const {
        if (!lc) { return rc? rc->v : unit; }
        if (!rc) { return lc->v; }
        return append(lc->v, rc->v);
      }
      T query(FnT const &append, T const &unit, IndexT a, IndexT b) const {
        if (b <= lp || rp <= a) { return unit; }
        if (a <= lp && rp <= b) { return v; }
        const auto vl = lc? lc->query(append, unit, a, b) : unit;
        const auto vr = rc? rc->query(append, unit, a, b) : unit;
        return append(vl, vr);
      }
      T at(T const &unit, IndexT k) const {
        const auto mid = (lp + rp) / 2;
        if (k < mid) {
          return lc? lc->at(unit, k) : unit;
        } else {
          return rc? rc->at(unit, k) : unit;
        }
      }
    };
    explicit thrifty_segment_tree(FnT const &app, T const &un, IndexT n):
      append(app), unit(un), N(p2cl2(n)),
      root(std::make_unique<Node>(un, 0, N)) {
    }
    thrifty_segment_tree(thrifty_segment_tree &&) = default;
    ~thrifty_segment_tree() = default;
    void update(IndexT k, T x) {
      root->update(append, unit, k, x);
    }
    T at(IndexT k) const {
      return root->at(unit, k);
    }
    T query(IndexT a, IndexT b) const {
      return root->query(append, unit, a, b);
    }
    T query() const {
      return query(0, N);
    }
  private:
    FnT const append;
    T const unit;
    size_t const N;
    std::unique_ptr<Node> root;

    static IndexT p2cl2(IndexT n) {
      IndexT N = 1;
      while (N < n) { N *= 2; }
      return N;
    }
};

template<typename T, typename FnT, typename IndexT = int>
thrifty_segment_tree<T, typename std::decay<FnT>::type, IndexT>
make_thrifty_segment_tree(FnT const &app, T const &un, IndexT n) {
  using F = typename std::decay<FnT>::type;
  return thrifty_segment_tree<T, F, IndexT>(app, un, n);
}

} // namespace

using namespace std;

int main() {
  // cout << fixed << setprecision(10);
  int N, Q;
  cin >> N >> Q;
  auto const mim = static_cast<lli const &(*)(lli const &, lli const &)>(std::min<lli>);
  auto tree = make_thrifty_segment_tree(mim, (1LL<<31)-1, N);
  REP(i, Q) {
    int COM, X, Y;
    cin >> COM >> X >> Y;
    if (COM == 0) {
      tree.update(X, Y);
    } else {
      cout << tree.query(X, Y+1) << '\n';
    }
  }
  return 0;
}



Measured memory_bytes: 8620