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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.txt = txt

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

k.u = l
k.w = j
k.r = e
d.o = l
d.v = l
d.q = m
m.y = j
m.x = k
e.s = d
e.y = d
e.u = j
e.q = j
e.x = l
l.x = d
l.z = d
j.s = d
j.y = d
j.u = e
j.q = e
j.x = l
assert k.w.x.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.r: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.txt = txt

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

k.u = l
k.w = j
k.r = e
d.o = l
d.v = l
d.q = m
m.y = j
m.x = k
e.s = d
e.y = d
e.u = j
e.q = j
e.x = l
l.x = d
l.z = d
j.s = d
j.y = d
j.u = e
j.q = e
j.x = l
assert k.w.x.z.q.txt == "m"