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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.p: A = None
        self.z: E = None
        self.txt = txt

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

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

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

m = A("m")
f = B("f")
k = C("k")
d = D("d")
j = E("j")
c = B("c")

m.w = d
m.u = d
m.o = k
f.w = j
f.z = j
f.v = k
f.p = m
k.u = d
k.v = c
k.q = c
k.y = j
k.p = j
d.r = m
d.u = m
d.x = m
d.z = j
j.t = d
c.w = j
c.z = j
c.v = k
c.p = m
assert m.o.u.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: D = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.p: A = None
        self.z: E = None
        self.txt = txt

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

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

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

m = A("m")
f = B("f")
k = C("k")
d = D("d")
j = E("j")
c = B("c")

m.w = d
m.u = d
m.o = k
f.w = j
f.z = j
f.v = k
f.p = m
k.u = d
k.v = c
k.q = c
k.y = j
k.p = j
d.r = m
d.u = m
d.x = m
d.z = j
j.t = d
c.w = j
c.z = j
c.v = k
c.p = m
assert m.o.u.z.t.txt == "d"