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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.z: B = None
        self.q: A = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

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

e = A("e")
k = B("k")
i = C("i")
n = D("n")
b = E("b")
c = E("c")

e.v = n
e.s = n
k.p = e
k.o = e
k.r = b
k.q = i
i.r = k
i.o = k
i.z = k
i.p = k
i.q = e
n.t = e
n.p = k
n.o = k
b.y = i
b.s = c
c.y = i
c.s = b
assert e.s.p.r.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.z: B = None
        self.q: A = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

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

e = A("e")
k = B("k")
i = C("i")
n = D("n")
b = E("b")
c = E("c")

e.v = n
e.s = n
k.p = e
k.o = e
k.r = b
k.q = i
i.r = k
i.o = k
i.z = k
i.p = k
i.q = e
n.t = e
n.p = k
n.o = k
b.y = i
b.s = c
c.y = i
c.s = b
assert e.s.p.r.s.y.txt == "i"