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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

a.z = c
a.o = b
a.v = b
a.x = i
l.w = e
d.p = e
e.p = d
e.t = d
e.z = c
e.x = c
i.w = e
g.p = e
c.w = e
b.w = e
assert a.z.w.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: B = None
        self.v: B = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

a.z = c
a.o = b
a.v = b
a.x = i
l.w = e
d.p = e
e.p = d
e.t = d
e.z = c
e.x = c
i.w = e
g.p = e
c.w = e
b.w = e
assert a.z.w.t.p.txt == "e"