#include<bits/stdc++.h>
using namespace std;
int n,seg[1000001];
void update(int k,int x){
  k += n-1;
  seg[k] = x;
  while(k > 0){
    k = (k-1)/2;
    seg[k] = min(seg[2*k+1],seg[2*k+2]);
  }
}
int find(int a,int b,int node,int l,int r){
  if(a > r || b < l) return(INT_MAX);
  if(a <= l && r <= b) return(seg[node]);
  return( min(find(a,b,2*node+1,l,(l+r)/2),find(a,b,2*node+2,(l+r)/2+1,r)) );
}
int main(){
  int q,com,x,y;
  cin >> n >> q;
  int a=1;
  while(a<n) a*=2;
  n = a;
  fill(seg,seg+1000001,INT_MAX);
  for(int i=0;i<q;i++){
    cin >> com >> x >> y;
    if(com == 0) update(x,y);
    if(com == 1) cout << find(x,y,0,0,n-1) << endl;
  }

  return (0);
}