{-# LANGUAGE BangPatterns #-}
import Data.Char
import Data.List

between :: Ord a => a -> a -> a -> Bool
between a b c = a <= b && b <= c

nAlpha :: Int
nAlpha = ord 'z' - ord 'a' + 1
nChars :: Integer
nChars = 1 + 2 * toInteger nAlpha + 10

decodeChar :: Char -> Int
decodeChar c
  | between 'a' c 'z' = ord c - ord 'a' + 1
  | between 'A' c 'Z' = ord c - ord 'A' + nAlpha + 1
  | between '0' c '9' = ord c - ord '0' + 2 * nAlpha + 1
  | otherwise = 100

rollHash :: Integer -> Integer -> Char -> Integer
rollHash len hash ch =
    (toInteger $! decodeChar ch) + (hash * nChars) `mod` nChars ^ len

calcHash :: String -> Integer
calcHash str = foldl' (rollHash $! genericLength str) 0 str

searchMatch :: String -> String -> [Int]
searchMatch pat str  = reverse $ thd $ foldl' iter (0, initHash, []) $ right ++ "*"
    where (left, right) = genericSplitAt len str
          patHash = calcHash pat
          initHash = calcHash left
          len = genericLength pat
          thd (_, _, a) = a
          iter (idx, hash, matches) ch =
            (idx + 1, rollHash len hash ch,
              if hash == patHash
                then idx : matches
                else matches)

main :: IO ()
main = do
  str <- getLine
  pat <- getLine
  mapM_ print $ searchMatch pat str