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

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

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

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

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

e = A("e")
b = B("b")
a = C("a")
d = D("d")
f = E("f")

e.w = d
e.z = d
b.w = e
b.s = d
b.o = d
a.r = e
a.t = e
a.z = b
d.u = b
f.o = b
f.u = e
assert a.t.z.u.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

e = A("e")
b = B("b")
a = C("a")
d = D("d")
f = E("f")

e.w = d
e.z = d
b.w = e
b.s = d
b.o = d
a.r = e
a.t = e
a.z = b
d.u = b
f.o = b
f.u = e
assert a.t.z.u.s.u.txt == "b"