class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: C = None
        self.t: C = None
        self.p: E = None
        self.txt = txt

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

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

i.z = m
i.v = m
i.x = e
i.u = k
k.y = i
k.s = m
k.r = m
k.q = j
e.x = m
e.v = j
m.w = j
m.p = j
m.q = e
m.t = e
j.o = k
j.u = k
assert k.q.u.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: C = None
        self.t: C = None
        self.p: E = None
        self.txt = txt

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

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

i.z = m
i.v = m
i.x = e
i.u = k
k.y = i
k.s = m
k.r = m
k.q = j
e.x = m
e.v = j
m.w = j
m.p = j
m.q = e
m.t = e
j.o = k
j.u = k
assert k.q.u.s.w.txt == "j"