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

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

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

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

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

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

k.z = a
e.v = k
e.p = k
d.u = j
d.s = a
d.z = a
d.o = i
d.v = i
j.s = i
j.z = i
j.u = i
j.q = k
i.o = a
a.u = j
a.s = d
a.z = d
a.o = i
a.v = i
assert d.u.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

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

k.z = a
e.v = k
e.p = k
d.u = j
d.s = a
d.z = a
d.o = i
d.v = i
j.s = i
j.z = i
j.u = i
j.q = k
i.o = a
a.u = j
a.s = d
a.z = d
a.o = i
a.v = i
assert d.u.q.z.txt == "a"