#include <iostream>
#include <vector>
#include <limits.h>

#define MAX 100000

using namespace std;

vector<int> a;
vector<int> ans;

int find(int s, int t){
  int min = a[s];
  for(int i = s; i <= t; ++i){
    if(min > a[i]){
      min = a[i];
    }
  }
  return min;
}

void update(int i, int x){
  a[i] = x;
}

int main(){
  int n = 0, q = 0;

  cin >> n >> q;
  for(int i = 0; i < n; ++i) a.push_back(INT_MAX);
  for(int i = 0; i < q; ++i){
    int com, x, y;
    cin >> com >> x >> y;
    if(com == 0){
      update(x, y);
    } else if(com == 1){
      ans.push_back(find(x, y));
    }
  }

  for(int i = 0; i < ans.size(); ++i){
    cout << ans[i] << endl;
  }

  return 0;
}

