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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

k = A("k")
i = B("i")
n = C("n")
d = D("d")
l = E("l")

k.p = l
k.y = i
k.q = n
i.o = d
i.r = n
n.x = d
n.t = d
n.v = d
d.s = n
l.o = k
l.s = d
l.u = i
l.q = i
assert i.r.x.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: B = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

k = A("k")
i = B("i")
n = C("n")
d = D("d")
l = E("l")

k.p = l
k.y = i
k.q = n
i.o = d
i.r = n
n.x = d
n.t = d
n.v = d
d.s = n
l.o = k
l.s = d
l.u = i
l.q = i
assert i.r.x.s.v.s.txt == "n"