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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.s: C = None
        self.txt = txt

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

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