#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#define INF ((1<<30)-1+(1<<30))

using namespace std;
int mn[1000000];
int n,q;
int a,b,c;

void update(int i,int x){
	i += 131072;
	mn[i] = x;
	i /= 2;
	while(i>0){
		int l = mn[2*i];
		int r = mn[2*i+1];
		mn[i] = min(l,r);
		i /= 2;
	}
}

int find(int l,int r,int bottom = 0,int top = 131072,int node = 1){
	if(l <= bottom && top <= r) return mn[node];
	if(top <= l || r <= bottom) return INF;
	int mid = (bottom+top)/2;
	int lmn = find(l,r,bottom,mid,2*node);
	int rmn = find(l,r,mid,top,2*node+1);
	return min(lmn,rmn);
}

int main(){
	cin >> n >> q;
	for(int i=1;i<=2*131072;i++){
		mn[i] = INF;
	}
	for(int i=0;i<q;i++){
		cin >> a >> b >> c;
		if(a==0){
			update(b,c);
		}
		else if(a==1){
			cout << find(b,c+1) << endl;
		}
	}
	return 0;
}