#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct rangeMinimumQueryDataStructure{
  int *a;
  int *b;
  int n;
  int sq;
} rmq;

rmq* newRMQ(int n,int ini){
  rmq *res=(rmq *)malloc(sizeof(int)*n);
  int sq=sqrt(n);
  res->n=n;
  res->sq=sq;
  res->a=(int *)malloc(sizeof(int)*n);
  res->b=(int *)malloc(sizeof(int)*((n+sq-1)/sq));
  int i;
  for(i=0;i<n;i++) res->a[i]=ini;
  for(i=0;i<(n+sq-1)/sq;i++) res->b[i]=ini;
  return res;
}

void update(rmq *a,int i,int x){
  int n=a->n;
  int sq=a->sq;
  a->a[i]=x;
  int min=x;
  int j;
  for(j=i/sq*sq;j<n && j<(i/sq+1)*sq;j++){
    min=MIN(min,a->a[j]);
  }
  a->b[i/sq]=min;
  return;
}

int find(rmq *a,int s,int t){
  int sq=a->sq;
  if(t-s<=sq){
    int min=a->a[s];
    int i;
    for(i=s+1;i<t;i++){
      min=MIN(min,a->a[i]);
    }
    return min;
  }
  int min=a->a[s];
  int i;
  for(i=s+1;i<(s/sq+1)*sq;i++) min=MIN(min,a->a[i]);
  for(;i+sq<t;i+=sq) min=MIN(min,a->b[i/sq]);
  for(;i<t;i++) min=MIN(min,a->a[i]);
  return min;
}

void run(void){
  int n,q;
  scanf("%d%d",&n,&q);
  rmq *a=newRMQ(n,2147483647);
  while(q--){
    int c,x,y;
    scanf("%d%d%d",&c,&x,&y);
    if(c==0){
      update(a,x,y);
    } else {
      printf("%d\n",find(a,x,y));
    }
  }
  return;
}

int main(void){
  run();
  return 0;
}

