class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.t: G = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: F = None
        self.v: B = None
        self.q: H = None
        self.t: H = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: D = None
        self.o: F = None
        self.t: B = None
        self.txt = txt

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

d = A("d")
b = B("b")
i = C("i")
a = D("a")
j = E("j")
c = F("c")
h = G("h")
n = H("n")
m = C("m")
e = F("e")

d.v = c
d.o = b
d.t = h
d.x = a
b.u = d
i.o = d
a.o = n
a.q = n
a.t = n
a.z = c
a.v = b
a.x = m
j.s = n
c.q = i
h.u = n
h.y = a
h.o = c
h.t = b
n.q = j
m.o = d
e.q = i
assert d.o.u.o.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.t: G = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: F = None
        self.v: B = None
        self.q: H = None
        self.t: H = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: D = None
        self.o: F = None
        self.t: B = None
        self.txt = txt

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

d = A("d")
b = B("b")
i = C("i")
a = D("a")
j = E("j")
c = F("c")
h = G("h")
n = H("n")
m = C("m")
e = F("e")

d.v = c
d.o = b
d.t = h
d.x = a
b.u = d
i.o = d
a.o = n
a.q = n
a.t = n
a.z = c
a.v = b
a.x = m
j.s = n
c.q = i
h.u = n
h.y = a
h.o = c
h.t = b
n.q = j
m.o = d
e.q = i
assert d.o.u.o.u.o.u.txt == "d"