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

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

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

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

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

m = A("m")
l = B("l")
b = C("b")
c = D("c")
j = E("j")

m.x = b
m.p = l
m.w = j
m.s = j
m.t = j
l.o = c
b.z = j
b.u = l
b.y = l
b.p = l
c.t = b
c.w = b
j.s = m
assert b.y.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.w: E = None
        self.s: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

m = A("m")
l = B("l")
b = C("b")
c = D("c")
j = E("j")

m.x = b
m.p = l
m.w = j
m.s = j
m.t = j
l.o = c
b.z = j
b.u = l
b.y = l
b.p = l
c.t = b
c.w = b
j.s = m
assert b.y.o.t.txt == "b"