import Data.Char

win :: String->Char->Bool
win g c = 
    ((g!!0)==c && (g!!1)==c && (g!!2)==c) || 
    ((g!!3)==c && (g!!4)==c && (g!!5)==c) || 
    ((g!!6)==c && (g!!7)==c && (g!!8)==c) || 
    ((g!!0)==c && (g!!3)==c && (g!!6)==c) || 
    ((g!!1)==c && (g!!4)==c && (g!!7)==c) || 
    ((g!!2)==c && (g!!5)==c && (g!!8)==c) || 
    ((g!!0)==c && (g!!4)==c && (g!!8)==c) || 
    ((g!!2)==c && (g!!4)==c && (g!!6)==c)

solve :: String->IO ()
solve grid = do
    if      win grid 'o' then putStrLn "o"
    else if win grid 'x' then putStrLn "x"
    else                      putStrLn "d"

main = do
    ss <- getContents
    mapM_ solve $ lines ss