class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: B = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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