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

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

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

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

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

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

e.w = f
e.y = c
e.x = a
a.t = f
c.u = d
c.x = e
c.y = e
c.s = m
f.o = c
f.y = e
m.t = a
m.p = a
m.r = c
m.z = d
m.u = e
d.t = a
d.p = a
d.r = c
d.z = m
d.u = e
assert f.o.x.x.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

e.w = f
e.y = c
e.x = a
a.t = f
c.u = d
c.x = e
c.y = e
c.s = m
f.o = c
f.y = e
m.t = a
m.p = a
m.r = c
m.z = d
m.u = e
d.t = a
d.p = a
d.r = c
d.z = m
d.u = e
assert f.o.x.x.t.o.txt == "c"