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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: B = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: D = None
        self.x: D = None
        self.r: B = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

h = A("h")
c = B("c")
a = C("a")
g = D("g")
e = E("e")
b = F("b")
j = E("j")
i = E("i")
l = D("l")
d = C("d")

h.x = c
c.z = a
a.u = h
g.y = l
g.p = c
g.v = d
e.q = c
e.o = h
e.t = i
b.o = h
b.z = l
b.x = l
b.r = c
b.v = i
b.s = g
j.q = c
j.o = h
j.t = i
i.q = c
i.o = h
i.t = j
l.y = g
l.p = c
l.v = a
d.u = h
assert b.z.v.u.x.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: B = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: D = None
        self.x: D = None
        self.r: B = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

h = A("h")
c = B("c")
a = C("a")
g = D("g")
e = E("e")
b = F("b")
j = E("j")
i = E("i")
l = D("l")
d = C("d")

h.x = c
c.z = a
a.u = h
g.y = l
g.p = c
g.v = d
e.q = c
e.o = h
e.t = i
b.o = h
b.z = l
b.x = l
b.r = c
b.v = i
b.s = g
j.q = c
j.o = h
j.t = i
i.q = c
i.o = h
i.t = j
l.y = g
l.p = c
l.v = a
d.u = h
assert b.z.v.u.x.z.u.txt == "h"