// Original C++ solution (slower):
#include <cstdio>

#include <cstdlib>

#include <iostream>

#include <string>

#include <cmath>

#include <algorithm>

#include <vector>

#include <queue>

#include <stack>

#include <map>

#include <set>



typedef long long ll;

using namespace std;



#define mod 1000000007

#define INF 2147483647

#define LLINF 2000000000000000000LL

#define PI 3.141592653589793



#define SIZE 200000





/* RangeMinimumQuery */

//0-index

struct RMQ{

    typedef int Type; //?????¨?????????(???????????\?????°OK)

    int segn2;

    vector<Type> data;

    

    RMQ(int n){

        segn2=1;

        while(segn2<n) segn2*=2;

        

        data.assign(segn2*2,INF);

    }

    

    //????????????????°????????±???????[a,b]

    Type query(int a,int b,int l=0,int r=-1,int k=0){

        

        if(r==-1) r+=segn2;

        

        if(a<=l && r<=b) return data[k];

        if(r<a || b<l) return INF;

        

        return min(query(a,b,l,(l+r)/2,k*2+1),query(a,b,(l+r)/2+1,r,k*2+2));

    }

    

    //k?????????????´????x?????????

    void set(int k,Type x){

        k+=segn2-1;

        data[k]=x;

        

        while(k>0){

            k=(k-1)/2;

            data[k]=min(data[k*2+1],data[k*2+2]);

        }

        

        return;

    }

};





int main(){

    int n,q,a,b,c;

    RMQ rmq(100000);

    

    scanf("%d%d",&n,&q);

    

    for(int i=0;i<q;i++){

        scanf("%d%d%d",&a,&b,&c);

        

        if(a==0){

            rmq.set(b,c);

        }else{

            printf("%d\n",rmq.query(b,c));

        }

    }

    

    

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cstring>



#include <iostream>

#include <complex>

#include <string>

#include <algorithm>

#include <vector>

#include <queue>

#include <stack>

#include <map>

#include <set>

#include <unordered_map>

#include <unordered_set>



#include <functional>

#include <cassert>



typedef long long ll;

using namespace std;



#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;



#define mod 1000000007 //1e9+7(prime number)

#define INF 1000000000 //1e9

#define LLINF 2000000000000000000LL //2e18

#define SIZE 100010



/* SimpleSegTree(0-index) */



struct SimpleSegTree{

  typedef int Type;

  int segn2;

  Type initVal;

  vector<Type> data;

  function<Type(Type, Type)> merge;

  

  SimpleSegTree(function<Type(Type, Type)> merge, int n, int initVal):

    initVal(initVal), merge(merge)

  {

    for(segn2=1; segn2<n; segn2*=2);

    data.assign(segn2*2, initVal);

  }

  

  //get minimum value [a,b)

  Type query(int a, int b, int l = 0, int r = -1, int k = 0){

    if(r == -1) r = segn2;

    if(a <= l && r <= b) return data[k];

    if(r <= a || b <= l) return initVal;

    return merge(query(a,b,l,(l+r)/2,k*2+1),query(a,b,(l+r)/2,r,k*2+2));

  }

  

  //set kth number x

  void set(int k, Type x){

    k += segn2-1;

    data[k] = x;

    while(k > 0){

      k = (k-1)/2;

      data[k] = merge(data[k*2+1], data[k*2+2]);

    }

  }

};



#define RMinQ(n) SimpleSegTree([](SimpleSegTree::Type a, SimpleSegTree::Type b){ return min(a, b); }, n, INF);

#define RMaxQ(n) SimpleSegTree([](SimpleSegTree::Type a, SimpleSegTree::Type b){ return max(a, b); }, n, -INF);

#define RSumQ(n) SimpleSegTree([](SimpleSegTree::Type a, SimpleSegTree::Type b){ return a + b; }, n, 0);

  

int main(){

  int n,q,a,b,c;

  

  scanf("%d%d", &n, &q);



  SimpleSegTree rmq([](SimpleSegTree::Type a, SimpleSegTree::Type b){ return min(a, b); }, n, (1LL << 31)-1);



  for(int i=0;i<q;i++){

    scanf("%d%d%d",&a,&b,&c);

    

    if(a==0){

      rmq.set(b, c);

    }else{

      printf("%d\n",rmq.query(b, c+1));

    }

  }

  

  return 0;

}




// Fastest known solution for this problem: