import java.util.Scanner

object Main extends App { 
  val sc = new Scanner(System.in)
  val n, q = sc.nextInt()
  val list = (for (i <- 0 until q) yield (sc.nextInt(), sc.nextInt(), sc.nextInt())).toList
 
  type Cmd = (Int, Int, Int)

  val df = 2147483647
  val an = Array.fill(n)(df)

  def update(i:Int, x:Int):Unit = an(i) = x
  def find(s:Int, t:Int):Int = {
    def iter(i:Int, m:Int):Int = {
      if (i > t) m 
      else iter(i+1, m min an(i))
    }
    iter(s, df)
  }

  def solver(l:List[Cmd], acc:List[Int]):List[Int] = {
    if (l.isEmpty) acc.reverse
    else {
      val (com, x, y) = l.head
      com match {
        case 0 => { update(x, y); solver(l.tail,acc) }
        case _ => solver(l.tail, find(x, y)::acc)
      }
    }
  }

  solver(list, Nil).foreach(println)
}

