#![allow(unused_imports, unused_macros, unknown_lints)]

use std::collections::*;
use std::cmp::Ordering::*;

macro_rules! dump {($($e:expr), +) => {print!(concat!($(stringify!($e), " = {:?}\n"), +), $($e), +)}}
macro_rules! max {($e0:expr, $($e:expr), +) => {{let mut r = $e0; $(r = std::cmp::max(r, $e);)+ r}}}
macro_rules! min {($e0:expr, $($e:expr), +) => {{let mut r = $e0; $(r = std::cmp::min(r, $e);)+ r}}}

fn main() {
  let (n,q) = get::tuple::<usize,usize>();
  let cxys = get::tuple3s::<usize,usize,usize>(q);
  
  let mut seg = SegTree::new(&vec![(1<<31)-1; n]);
  for (c,x,y) in cxys {
    if c == 0 {
      seg.update(x+1,y)
    } else {
      println!("{}", seg.query(x+1,y+1))
    }
  }
}

#[allow(dead_code)]
struct SegTree {
  size: usize,
  depth: usize,
  vec: Vec<usize>
}

#[allow(dead_code)]
impl SegTree {
  fn new(xs: &[usize]) -> SegTree {
    let l = xs.len();
    let d = (0..).skip_while(|&i|(1<<i)<l).next().unwrap();
    let mut v = vec![(1<<31)-1; 1<<(d+1)];
    
    for (&x,i) in xs.iter().zip((1<<d)..) {v[i] = x}
    for i in (1..(1<<d)).rev() {v[i] = min!(v[i<<1], v[(i<<1)|1])}
    
    SegTree {size: l, depth: d, vec: v}
  }
  
  fn update(&mut self, i: usize, x: usize) {
    self.vec[i+(1<<self.depth)-1] = x;
    
    let mut parent = (i+(1<<self.depth)-1) >> 1;
    while parent > 0 {
      self.vec[parent] = min!(self.vec[parent<<1], self.vec[(parent<<1)|1]);
      parent = parent >> 1
    }
  }
  
  fn query(&self, i: usize, j: usize) -> usize {
    fn rec(seg: &SegTree, i: usize, j: usize, k: usize, l: usize, r: usize) -> usize {
      if j < l || r < i {return (1<<31)-1}
      if i <= l && r <= j {return seg.vec[k]}
      let left = rec(seg, i, j, k<<1, l, l+((r-l)>>1));
      let right = rec(seg, i, j, (k<<1)|1, r-((r-l)>>1), r);
      min!(left, right)
    }
    
    rec(self, i, j, 1, 1, 1<<self.depth)
  }
}
      

#[allow(dead_code)]
mod get {
  use std::io::*;
  use std::str::*;
  use std::process::*;

  pub fn val<T: FromStr>() -> T {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    if buf.is_empty() {println!("No input"); exit(0)}
    buf.trim_right().parse::<T>().ok().unwrap()
  }

  pub fn vals<T: FromStr>(n: usize) -> Vec<T> {
    let mut vec: Vec<T> = vec![];
    for _ in 0 .. n {
      vec.push(val());
    }
    vec
  }

  pub fn tuple<T1: FromStr, T2: FromStr>() -> (T1, T2) {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    if buf.is_empty() {println!("No input"); exit(0)}
    let mut it = buf.trim_right().split_whitespace();
    let x = it.next().unwrap().parse::<T1>().ok().unwrap();
    let y = it.next().unwrap().parse::<T2>().ok().unwrap();
    (x, y)
  }

  pub fn tuples<T1: FromStr, T2: FromStr>(n: usize) -> Vec<(T1, T2)> {
    let mut vec: Vec<(T1, T2)> = vec![];
    for _ in 0 .. n {
      vec.push(tuple());
    }
    vec
  }

  pub fn tuple3<T1: FromStr, T2: FromStr, T3: FromStr>() -> (T1, T2, T3) {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    if buf.is_empty() {println!("No input"); exit(0)}
    let mut it = buf.trim_right().split_whitespace();
    let x = it.next().unwrap().parse::<T1>().ok().unwrap();
    let y = it.next().unwrap().parse::<T2>().ok().unwrap();
    let z = it.next().unwrap().parse::<T3>().ok().unwrap();
    (x, y, z)
  }

  pub fn tuple3s<T1: FromStr, T2: FromStr, T3: FromStr>(n: usize) -> Vec<(T1, T2, T3)> {
    let mut vec: Vec<(T1, T2, T3)> = vec![];
    for _ in 0 .. n {
      vec.push(tuple3());
    }
    vec
  }

  pub fn vec<T: FromStr>() -> Vec<T> {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    if buf.is_empty() {println!("No input"); exit(0)}
    buf.trim_right().split_whitespace().map(|t| t.parse::<T>().ok().unwrap()).collect()
  }

  pub fn mat<T: FromStr>(h: usize) -> Vec<Vec<T>> {
    let mut mat = vec![];
    for _ in 0 .. h {
      mat.push(vec());
    }
    mat
  }

  pub fn chars() -> Vec<char> {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    if buf.is_empty() {println!("No input"); exit(0)}
    buf.trim_right().chars().collect()
  }
}

#[allow(dead_code)]
mod put {
  use std::string::*;

  pub fn vec<T: ToString>(vec: &Vec<T>, sep: &str) {
    let out = vec.iter().map(|e| e.to_string()).collect::<Vec<_>>().as_slice().join(sep);
    println!("{}", out);
  }

  pub fn mat<T: ToString>(mat: &Vec<Vec<T>>, sep: &str) {
    for v in mat {
      vec(v, sep);
    }
  }
}



Measured memory_bytes: 12080