#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <tuple>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
#include <list>
#include <cstring>
using namespace std;
#define pi pair<int,int>
#define pl pair<long long,long long>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
//#define MM 1000000000
//#define MOD MM+7
typedef long long ll;
const int MM = 1e9;
const int MOD = MM+7;
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
// 'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

template<typename T> //最大公約数
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T> //最小公倍数
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}

const int COM_MAX = 500500;
long long fac[COM_MAX],finv[COM_MAX],inv[COM_MAX];
void init(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < COM_MAX; i++){
        fac[i] = fac[i-1]*i%MOD;
        inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD;
        finv[i] = finv[i-1]*inv[i]%MOD;
    }
}
long long COM(int n,int k){
    if(n < k || n < 0 || k < 0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}


struct UnionFind {
	vector<int> par, rank, cnt;
	UnionFind(int n) : par(n), rank(n, 0), cnt(n, 1){
		for(int i = 0; i < n; ++i) par[i] = i;
	}
 
	int find(int x) {
		if (x == par[x]) return x;
		return par[x] = find(par[x]);
	}
	
 
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y) return;
 
		if (rank[x] < rank[y]) swap(x, y);
 
		par[y] = x;
		cnt[x] += cnt[y];
		if (rank[x] == rank[y]) rank[x]++;
	}
 
	bool same(int x, int y) {
		return find(x) == find(y);
	}
 
	int size(int x) {
		return cnt[find(x)];
	}
};


// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

// a^{-1} mod を計算する
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

const ll InitNum = pow(2, 31) -1;
struct SegTree {
	vector<int> pos;
	int maxLimit;

	void Init(int _N){
		maxLimit = 1;
		while (maxLimit < _N){
			maxLimit *= 2;
		}

		pos.assign(maxLimit*2+1, InitNum);
	}

	void Update(int index, int num){
		index += maxLimit-1;
		pos[index] = num;
		while (index > 0){
			index = (index-1) / 2;
			pos[index] = min(pos[index*2 + 1], pos[index*2 + 2]);
		}
	}

	int Query(int givenleft, int givenright, int now, int left, int right){
		if (right <= givenleft || givenright <= left){
			return InitNum;
		}
		else if (givenleft <= left && right <= givenright){
			return pos[now];
		} else {
			int leftUpdate = Query(givenleft, givenright, now*2+1, left, (left+right)/2);
			int rightUpdate = Query(givenleft, givenright, now*2+2, (left+right)/2, right);
			return min(leftUpdate, rightUpdate);
		}
	}
};



int N, Q;
vector<ll> input(){
	cin >> N >> Q;
	SegTree segtree;
	segtree.Init(N);
	vector<ll> ans(0);
	for (int i = 0; i < Q; i++){
		int c, x, y;
		cin >> c >> x >> y;
		if (c == 0){
			segtree.Update(x, y);
		} else {
			int res = segtree.Query(x, y+1, 0, 0, segtree.maxLimit);
			ans.push_back(res);
		}
	}
	return ans;
}

int main(){
	vector<ll> ans = input();
	for (int i = 0; i < ans.size(); i++){
		cout << ans[i] << endl;
	}
}


Measured memory_bytes: 4568