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

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

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

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

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

e = A("e")
n = B("n")
a = C("a")
k = D("k")
m = E("m")

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

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

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

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

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

e = A("e")
n = B("n")
a = C("a")
k = D("k")
m = E("m")

e.y = a
e.x = m
n.z = k
n.u = m
a.v = n
a.q = k
a.p = e
k.q = m
k.u = n
k.p = n
k.r = a
k.t = a
m.t = n
m.p = e
m.o = a
assert a.q.q.o.txt == "a"