#include<bits/stdc++.h>
using namespace std;int d[1<<18],n,q,r,x,y,i;int m(int l,int r,int k){return (x<=l&&r<=y)?d[k]:(y<=l||r<=x)?INT_MAX:min(m(l,(l+r)/2,k*2+1),m((l+r)/2,r,k*2+2));}int main(){cin>>n>>q;r=2;while(r<n)r*=2;n=r,r*=2;while(r--)d[r]=INT_MAX;while(q--){scanf("%d%d%d",&r,&x,&y);if(r){y++;cout<<m(0,n,0)<<endl;}else{i=x+n-1,d[i]=y;while(i)i=(i-1)/2,d[i]=min(d[i*2+1],d[i*2+2]);}}return 0;}