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

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

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

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

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

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

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

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

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

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

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