import Control.Applicative
import Control.Monad
import Data.Array.IO

main = do
    [n,q] <- map read.words<$>getLine
    initArray <- newArray (0,n-1) (2^31-1)
    query q initArray
    
query 0 _   = return ()
query n arr = do
    q <- getQuery
    q arr >>= query (n-1)

getQuery = do
    (c:xs) <- map read.words<$>getLine
    case c of
      0 -> let [s,t,x] = xs in return (updateArr s t x)
      1 -> let [i] = xs in return (findArr i)

updateArr :: (Enum i, Ix i) => i -> i -> Int -> IOUArray i Int -> IO (IOUArray i Int)
updateArr s t x arr = (forM [s..t] $ \i -> writeArray arr i x) >> return arr

findArr :: Ix i => i -> IOUArray i Int -> IO (IOUArray i Int)
findArr i arr = readArray arr i >>= \x -> print x >> return arr
