import Data.Maybe
import Data.List

data Dubious a = Fixed a | Unfixed deriving Show


main = do
  s <- getLine >>= return . (map (\x -> if x=='?' then Unfixed else (Fixed x))) :: IO [Dubious Char]
  t <- getLine >>= return . (map (\x -> Fixed x)) :: IO [Dubious Char]

  let
    lent = length t
    lens = length s

  
  putStrLn $ func3 (sort (map (map func2) (catMaybes [func s t i | i<-[0..lens-lent]])))


  where
    equalDubious :: Eq a => Dubious a -> Dubious a -> Bool
    equalDubious Unfixed y = True
    equalDubious x Unfixed = True 
    equalDubious (Fixed x) (Fixed y) = if x/=y then False else True
    

    fix :: Eq a => Dubious a -> Dubious a -> Dubious a
    fix Unfixed (Fixed a) = Fixed a
    fix (Fixed a) Unfixed = Fixed a
    fix Unfixed Unfixed = Unfixed
    fix (Fixed a) (Fixed b) = if a/=b then Unfixed else Fixed a



    func s t i = if and (zipWith equalDubious t s') then (Just r) else Nothing
      where
        lt = length t
        ls = length s
        s' = take lt (drop i s)
        r = zipWith fix s ((take i (repeat Unfixed)) ++ t ++ (take (ls-i-lt) (repeat Unfixed)))

    func2 :: Dubious Char -> Char
    func2 (Fixed x) = x
    func2 Unfixed = 'a'

    func3 :: [String] -> String
    func3 [] = "UNRESTORABLE"
    func3 xs = head xs
