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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.txt = txt

e = A("e")
d = B("d")
m = C("m")
b = D("b")
l = D("l")
f = B("f")
g = D("g")
a = C("a")
h = C("h")

e.x = h
d.p = e
d.v = h
m.t = h
m.u = h
m.z = a
b.z = e
b.s = a
l.z = e
l.s = a
f.p = e
f.v = a
g.z = e
g.s = a
a.t = m
a.z = m
a.u = h
h.t = a
h.u = a
h.z = m
assert e.x.z.z.u.z.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.txt = txt

e = A("e")
d = B("d")
m = C("m")
b = D("b")
l = D("l")
f = B("f")
g = D("g")
a = C("a")
h = C("h")

e.x = h
d.p = e
d.v = h
m.t = h
m.u = h
m.z = a
b.z = e
b.s = a
l.z = e
l.s = a
f.p = e
f.v = a
g.z = e
g.s = a
a.t = m
a.z = m
a.u = h
h.t = a
h.u = a
h.z = m
assert e.x.z.z.u.z.u.t.txt == "a"