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

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

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

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

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

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

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

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

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

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

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

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

k.u = e
k.v = e
k.o = h
e.t = h
e.s = m
e.w = m
h.o = i
h.w = c
h.z = k
i.t = j
j.r = c
m.t = j
c.o = m
c.w = h
c.z = k
assert m.t.r.z.o.w.txt == "c"