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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: D = None
        self.r: C = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.p: B = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

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

d = A("d")
a = B("a")
i = C("i")
h = D("h")
j = E("j")

d.t = a
d.z = i
a.t = h
a.o = h
a.s = h
a.r = i
i.x = d
i.v = d
i.z = a
i.o = h
h.t = j
h.z = d
h.w = d
h.p = a
h.x = i
j.u = a
j.s = a
assert d.z.v.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: D = None
        self.r: C = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.p: B = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

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

d = A("d")
a = B("a")
i = C("i")
h = D("h")
j = E("j")

d.t = a
d.z = i
a.t = h
a.o = h
a.s = h
a.r = i
i.x = d
i.v = d
i.z = a
i.o = h
h.t = j
h.z = d
h.w = d
h.p = a
h.x = i
j.u = a
j.s = a
assert d.z.v.z.z.txt == "a"