import qualified Data.ByteString.Char8 as B
import Data.List
import Data.Maybe
import Control.Applicative

main = do
 [n,_] <- map read . words <$> getLine
 cxys <- map ((\[c,x,y]->(c,(x,y))) . map (fst . fromJust . B.readInt) . B.words) . B.lines <$> B.getContents
 let seg = fromList n (replicate n (2^31-1))
 mapM_ print (rmq n seg cxys)

rmq n seg = reverse . fst . foldl' process ([],seg)
 where
  process (lg,seg) (c,(x,y))
   | c==0 = (lg, update n seg x y)
   | c==1 = (query n seg x y : lg, seg)


data SegTree a = Leaf a | Node a (SegTree a) (SegTree a) deriving (Eq, Show)

val :: SegTree a -> a
val (Leaf v) = v
val (Node v _ _) = v

fromList :: (Ord a) => Int -> [a] -> SegTree a
fromList 1 [x] = Leaf x
fromList n xs  = Node (min (val left) (val right)) left right
 where
  n' = div n 2
  (xs1,xs2) = splitAt n' xs
  left = fromList n' xs1
  right = fromList (n-n') xs2

update :: (Ord a) => Int -> SegTree a -> Int -> a -> SegTree a
update 1 (Leaf v) 0 x = Leaf x
update n (Node v l r) i x
 | i < n' = Node (min (val left) v) left r
 | otherwise = Node (min v (val right)) l right
 where
  n' = div n 2
  left = update n' l i x
  right = update (n-n') r (i-n') x

query :: (Ord a) => Int -> SegTree a -> Int -> Int -> a
query 1 (Leaf v) 0 0 = v
query n (Node v l r) i j
 | (i,j) == (0,n-1) = v
 | j <  n' = query n' l i j
 | i >= n' = query (n-n') r (i-n') (j-n')
 | otherwise = min (query n' l i (n'-1)) (query (n-n') r 0 (j-n'))
 where n' = div n 2