object Main {
	
	def find(array: Seq[Int], s: Int, t: Int): Int = array.slice(s, t+1).min
	
	def update(array: Seq[Int], i: Int, x: Int): Seq[Int] = array.updated(i,x)
	
	def main(args: Array[String]){
		val sc = new java.util.Scanner(System.in)
		val n, q = sc.nextInt
		
		var a = Seq.fill(n)(Integer.MAX_VALUE)
		
		for(_ <- 1 to q){
			val com,x,y = sc.nextInt
			if(com==0) a = update(a,x,y)
			else println(find(a,x,y))
		}
	}
}