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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.q: C = None
        self.p: D = None
        self.txt = txt

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

a = A("a")
i = B("i")
h = C("h")
e = D("e")
b = C("b")

a.z = e
a.t = i
a.u = b
i.x = a
h.t = e
h.p = e
h.r = b
h.q = b
e.x = b
b.t = e
b.p = e
b.r = h
b.q = h
assert e.x.r.p.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.q: C = None
        self.p: D = None
        self.txt = txt

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

a = A("a")
i = B("i")
h = C("h")
e = D("e")
b = C("b")

a.z = e
a.t = i
a.u = b
i.x = a
h.t = e
h.p = e
h.r = b
h.q = b
e.x = b
b.t = e
b.p = e
b.r = h
b.q = h
assert e.x.r.p.x.t.txt == "e"