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

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

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

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

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

e = A("e")
j = B("j")
f = C("f")
m = D("m")
n = E("n")

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

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

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

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

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

e = A("e")
j = B("j")
f = C("f")
m = D("m")
n = E("n")

e.v = n
e.s = n
e.t = m
e.r = f
j.x = f
j.o = m
f.p = j
f.r = j
f.y = j
f.t = j
f.z = n
m.z = j
m.x = j
m.y = e
n.y = j
n.u = e
n.x = m
assert f.z.y.x.z.txt == "n"