main = print =<< solver <$> getLine <*> getLine

solver :: String -> String -> String
solver s' t = h (fmap (zipWith g s') (filter (and . (zipWith f s')) ts))
 where
    ts = fmap ((\l x -> (replicate x '?') ++ t ++ (replicate (l - x) '?')) n) [0..n]
    n = (length s') - (length t)
    f a b = (a == '?') || (a == b) || (b == '?')
    g a b = if (a == '?') then (if (b == '?') then 'a' else b) else a
    h [] = "UNRESTORABLE"
    h a = minimum a