import Control.Monad (replicateM)
import Data.List (intersperse)

main :: IO ()
main = do
  n <- getLine
  ls <- getNLine_ $ (rInt . head . words) n
  putStrLn $ (concat . intersperse "\n" . biList) ls

biList :: [a] -> [a]
biList [] = []
biList (l:ls) = l : l : (biList ls)

-- 複数行入力
getNLine_ :: Int -> IO [String]
getNLine_ n = replicateM n getLine

-- 文字列を整数に
rInt :: String -> Int
rInt str = read str :: Int