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

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

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

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

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

n = A("n")
k = B("k")
h = C("h")
e = D("e")
l = E("l")

n.x = k
n.v = h
k.x = l
k.q = e
h.q = k
h.u = n
h.o = n
h.w = l
h.t = e
e.y = h
e.s = h
e.t = k
e.z = n
l.r = e
l.v = n
assert e.y.q.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

n = A("n")
k = B("k")
h = C("h")
e = D("e")
l = E("l")

n.x = k
n.v = h
k.x = l
k.q = e
h.q = k
h.u = n
h.o = n
h.w = l
h.t = e
e.y = h
e.s = h
e.t = k
e.z = n
l.r = e
l.v = n
assert e.y.q.q.z.txt == "n"