main :: IO ()
main = do
    s' <- getLine
    t  <- getLine
    putStrLn $ solve s' t

solve :: String -> String -> String
solve s' t | length s' < length t = "UNRESTORABLE"
           | otherwise            = solve' s' t
    
solve' :: String -> String -> String
solve' s' t | null smallests = "UNRESTORABLE"
            | otherwise      = minimum smallests
  where
    smallests = 
        [ smallest a ++ t ++ smallest b 
        | (a, x', b) <- substrings (length t) s'
        , match x' t
        ]

smallest :: String -> String
smallest = map (\c -> if c == '?' then 'a' else c)

substrings :: Int -> String -> [(String, String, String)]
substrings n xs | length xs < n = []
                | otherwise     = go [] (take n xs) (drop n xs)
  where 
    go xs ys [] = [(xs, ys, [])]
    go xs (y : ys) (z : zs) =
        (xs, (y : ys), (z : zs)) : go (xs ++ [y]) (ys ++ [z]) zs

match :: String -> String -> Bool
match [] [] = True
match (x : xs) (y : ys) | x == y    = match xs ys
                        | x == '?'  = match xs ys
                        | otherwise = False