{-# LANGUAGE OverloadedStrings, ViewPatterns #-}
import qualified Data.ByteString.Char8 as B
import Data.List
import Data.Ord

main :: IO ()
main = B.getLine >>= main'
    where
        main' s = B.getLine >>= B.putStrLn . solve s

solve :: B.ByteString -> B.ByteString -> B.ByteString
solve s t
    | null res = "UNRESTORABLE"
    | otherwise = snd $ head res
    where
        m = B.length s
        n = B.length t

        res = sortBy (comparing snd) . filter fst $ gen s t m n

gen :: B.ByteString -> B.ByteString -> Int -> Int -> [(Bool, B.ByteString)]
gen s@(B.uncons -> Just ('?', xs)) t m n
    | n > m = [(False, B.map mf s)]
    | check t s = fmap mf2 next `mappend` fmap mf3 next2
    | otherwise = fmap mf2 next
    where
        next = gen xs t (m - 1) n
        next2 = gen (B.drop n s) t (m - n) n
        mf c
            | c == '?' = 'a'
            | otherwise = c
        mf2 (b, ns) = (b, B.cons 'a' ns)
        mf3 (_, ns) = (True, t `B.append` ns)

gen s@(B.uncons -> Just (x, xs)) t m n
    | n > m = [(False, B.map mf s)]
    | check t s = fmap mf2 next `mappend` fmap mf3 next2
    | otherwise = fmap mf2 next
    where
        next = gen xs t (m - 1) n
        next2 = gen (B.drop n s) t (m - n) n
        mf c
            | c == '?' = 'a'
            | otherwise = c
        mf2 (b, ns) = (b, B.cons x ns)
        mf3 (_, ns) = (True, t `B.append` ns)
gen _ _ _ _= [(False, B.empty)]


check :: B.ByteString -> B.ByteString -> Bool
check (B.uncons -> Just (x, xs)) (B.uncons -> Just (y, ys))
    | y == '?' || x == y = check xs ys
    | otherwise = False
check _ _ = True
