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

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

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

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

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

n = A("n")
k = B("k")
i = C("i")
c = D("c")
l = E("l")
a = B("a")
j = A("j")

n.v = i
k.x = a
k.p = c
k.y = i
i.t = k
i.s = c
c.z = i
l.p = k
l.v = i
a.x = k
a.p = c
a.y = i
j.v = i
assert i.s.z.s.z.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

n = A("n")
k = B("k")
i = C("i")
c = D("c")
l = E("l")
a = B("a")
j = A("j")

n.v = i
k.x = a
k.p = c
k.y = i
i.t = k
i.s = c
c.z = i
l.p = k
l.v = i
a.x = k
a.p = c
a.y = i
j.v = i
assert i.s.z.s.z.s.z.txt == "i"