{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import           Data.List  (find)
import           Data.Maybe (fromMaybe)

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

solve :: String -> String -> Maybe String
solve s' t = fillWithA <$> matchRight s' t

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

matchRight :: String -> String -> Maybe String
matchRight s' t = concat3 <$> find match (reverse $ substrs s' (length t)) where
  match (x, y, z) = and $ zipWith (\c d -> c == d || c == '?') y t
  concat3 (x, _, z) = x ++ t ++ z

substrs :: String -> Int -> [(String, String, String)]
substrs s n = go [] s where
  go p s
    | length xs < n = []
    | otherwise     = (p, xs, ys) : go (p ++ [head s]) (tail s)
    where (xs, ys) = splitAt n s
