#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stderr, stdin, stdout, BufWriter, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::{i64, u64, usize};
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , [ $ t : tt ] ) => { { let len = read_value ! ( $ next , usize ) ; ( 0 .. len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , bytes ) => { read_value ! ( $ next , String ) . into_bytes ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[allow(unused_macros)]
macro_rules! dbg {
    ($($a:expr),*) => {
        writeln!(&mut stderr(), concat!($(stringify!($a), " = {:?}, "),*), $($a),*).unwrap();
    }
}

trait Monoid {
    type T: Clone;
    fn id() -> Self::T;
    fn op(a: &Self::T, b: &Self::T) -> Self::T;
}
struct SegmentTree<M: Monoid> {
    n_leaf: usize,
    data: Vec<M::T>,
}
impl<M: Monoid> SegmentTree<M> {
    #[allow(dead_code)]
    fn new(_n: usize) -> SegmentTree<M> {
        let mut n = 1;
        while n < _n {
            n *= 2;
        }
        SegmentTree {
            n_leaf: n,
            data: vec![M::id(); 2 * n - 1],
        }
    }
    #[allow(dead_code)]
    fn update(&mut self, i: usize, val: M::T) {
        let mut i = i + self.n_leaf - 1;
        self.data[i] = val;
        while i > 0 {
            i = (i - 1) / 2;
            self.data[i] = M::op(&self.data[2 * i + 1], &self.data[2 * i + 2]);
        }
    }
    #[allow(dead_code)]
    fn _query(&self, left: usize, right: usize, i: usize, l: usize, r: usize) -> M::T {
        if right <= l || r <= left {
            M::id()
        } else if left <= l && r <= right {
            self.data[i].clone()
        } else {
            let child_left = self._query(left, right, i * 2 + 1, l, (l + r) / 2);
            let child_right = self._query(left, right, i * 2 + 2, (l + r) / 2, r);
            M::op(&child_left, &child_right)
        }
    }
    #[allow(dead_code)]
    fn query(&self, left: usize, right: usize) -> M::T {
        self._query(left, right, 0, 0, self.n_leaf)
    }
}
impl<M: Monoid> std::ops::Index<usize> for SegmentTree<M> {
    type Output = M::T;
    fn index(&self, index: usize) -> &Self::Output {
        &self.data[index + self.n_leaf - 1]
    }
}

struct MinI64;
impl Monoid for MinI64 {
    type T = i64;
    fn id() -> Self::T {
        (1 << 31) - 1
    }
    fn op(a: &Self::T, b: &Self::T) -> Self::T {
        std::cmp::min(*a, *b)
    }
}

#[allow(non_snake_case)]
#[allow(dead_code)]
fn main() {
    input!{
        n: usize,
        q: usize,
        query: [(usize, usize, usize); q],
    }
    let mut seg: SegmentTree<MinI64> = SegmentTree::new(n);
    for (com, x, y) in query {
        if com == 0 {
            seg.update(x, y as i64);
        } else {
            println!("{}", seg.query(x, y + 1));
        }
    }
}


Measured memory_bytes: 11168