let solve lst =
  let diag c xs = (List.nth xs 0 = c && List.nth xs 4 = c && List.nth xs 8 = c) ||
                    (List.nth xs 2 = c && List.nth xs 4 = c && List.nth xs 6 = c) in
  let hor c xs = List.exists (fun x -> List.nth xs (x+0) = c && List.nth xs (x+1) = c && List.nth xs (x+2) = c) [0;3;6] in
  let ver c xs = List.exists (fun x -> List.nth xs (x+0) = c && List.nth xs (x+3) = c && List.nth xs (x+6) = c) [0;1;2] in
  if diag "o" lst || hor "o" lst || ver "o" lst then "o" else if diag "x" lst || hor "x" lst || ver "x" lst then "x" else "d"

let _ =
  try
    while true do
      let lst = Str.split (Str.regexp "") (read_line ()) in
      Printf.printf "%s\n" @@ solve lst
    done
  with
    End_of_file -> ()