import Data.IntMap ((!))
import qualified Data.IntMap.Strict as M
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
 mapM_ print (rmq n cxys)

rmq :: Int -> [(Int,(Int,Int))] -> [Int]
rmq n = reverse . fst . foldl' process ([], M.empty)

process (lg,m) (c,(x,y))
 | c==0 = (lg, M.insert x y m)
 | c==1 = (minimum (map (\i -> M.findWithDefault (2^31-1) i m) [x..y]) : lg, m)