class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.u: B = None
        self.o: C = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

k.v = l
k.z = l
k.u = l
k.o = i
k.s = d
l.q = k
l.u = k
l.s = k
l.z = i
l.r = i
i.u = l
a.u = l
a.r = d
a.o = k
d.o = k
assert d.o.s.o.s.o.txt == "k"