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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: A = None
        self.o: D = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: A = None
        self.o: D = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

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

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

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

m.u = e
m.y = f
m.v = a
a.q = f
f.z = l
f.o = l
f.x = l
f.t = m
f.p = a
l.v = m
e.s = a
e.u = l
assert l.v.y.t.txt == "m"