class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: B = None
        self.s: E = None
        self.y: D = None
        self.v: G = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: B = None
        self.p: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: F = None
        self.p: F = None
        self.u: D = None
        self.txt = txt

d = A("d")
f = B("f")
c = C("c")
i = D("i")
a = E("a")
n = F("n")
b = G("b")
k = B("k")

d.o = f
d.p = f
d.s = a
d.y = i
d.x = i
d.v = b
f.r = k
f.u = k
f.p = k
c.y = d
c.u = d
i.v = d
i.r = d
a.q = i
n.v = c
n.x = b
b.t = f
b.v = n
b.p = n
b.u = i
k.r = f
k.u = f
k.p = f
assert i.v.v.u.r.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: B = None
        self.s: E = None
        self.y: D = None
        self.v: G = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: B = None
        self.p: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: F = None
        self.p: F = None
        self.u: D = None
        self.txt = txt

d = A("d")
f = B("f")
c = C("c")
i = D("i")
a = E("a")
n = F("n")
b = G("b")
k = B("k")

d.o = f
d.p = f
d.s = a
d.y = i
d.x = i
d.v = b
f.r = k
f.u = k
f.p = k
c.y = d
c.u = d
i.v = d
i.r = d
a.q = i
n.v = c
n.x = b
b.t = f
b.v = n
b.p = n
b.u = i
k.r = f
k.u = f
k.p = f
assert i.v.v.u.r.y.r.txt == "d"