import sys

x=["ooo","xxx"]

for s in sys.stdin:

    c="d"

    for i in range(3):

        if s[i:9:3]in x:

            c=s[i]

            break

        j=i*3

        if s[j:j+3]in x:

            c=s[j]

            break

    else:

        if s[0::4] in x or s[2:7:2] in x:c=s[4]

    print(c)
import sys

def f(a,b,c):

    return a if a!="s"and a==b==c else 0

for s in sys.stdin:

    for i in range(3):

        c=f(*s[i:9:3])

        if c: break

        j=i*3

        c=f(*s[j:j+3])

        if c: break

    else:

        a=s[4]

        if f(*s[0:9:4])or f(*s[2:7:2]):c=a

        else:c="d"

    print(c)
import sys

x = ["ooo", "xxx"]
for s in sys.stdin:
    c = "d"
    for i in range(3):
        if s[i:9:3] in x:
            c = s[i]
            break
        j = i * 3
        if s[j : j + 3] in x:
            c = s[j]
            break
    else:
        if s[0::4] in x or s[2:7:2] in x:
            c = s[4]
    print(c)

import sys


def f(a, b, c):
    return a if a != "s" and a == b == c else 0


for s in sys.stdin:
    for i in range(3):
        c = f(*s[i:9:3])
        if c:
            break
        j = i * 3
        c = f(*s[j : j + 3])
        if c:
            break
    else:
        a = s[4]
        if f(*s[0:9:4]) or f(*s[2:7:2]):
            c = a
        else:
            c = "d"
    print(c)

-x = ["ooo", "xxx"] + +def f(a, b, c): +    return a if a != "s" and a == b == c else 0 + + -    c = "d" -        if s[i:9:3] in x: -            c = s[i] +        c = f(*s[i:9:3]) +        if c: -        if s[j : j + 3] in x: -            c = s[j] +        c = f(*s[j : j + 3]) +        if c: -        if s[0::4] in x or s[2:7:2] in x: -            c = s[4] +        a = s[4] +        if f(*s[0:9:4]) or f(*s[2:7:2]): +            c = a +        else: +            c = "d"