class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: C = None
        self.z: B = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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