-- acrostic.hs --- Acrostic

-- author: Seong Yong-ju <sei40kr@gmail.com>

main :: IO ()
main = do
  s <- readLn
  w <- (read :: String -> Int) <$> getLine
  putStrLn $ map (s !!) [w,0 .. (length s)]
