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

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

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

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

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

c = A("c")
a = B("a")
e = C("e")
i = D("i")
d = E("d")
b = C("b")
h = C("h")
j = E("j")
m = D("m")

c.u = a
c.x = a
c.o = e
c.q = e
a.x = d
a.w = i
e.z = c
e.s = a
e.o = m
i.z = a
i.t = c
i.w = j
i.u = h
i.s = m
d.x = b
b.z = c
b.s = a
b.o = i
h.z = c
h.s = a
h.o = m
j.x = e
m.z = a
m.t = c
m.w = d
m.u = b
m.s = i
assert b.z.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

c = A("c")
a = B("a")
e = C("e")
i = D("i")
d = E("d")
b = C("b")
h = C("h")
j = E("j")
m = D("m")

c.u = a
c.x = a
c.o = e
c.q = e
a.x = d
a.w = i
e.z = c
e.s = a
e.o = m
i.z = a
i.t = c
i.w = j
i.u = h
i.s = m
d.x = b
b.z = c
b.s = a
b.o = i
h.z = c
h.s = a
h.o = m
j.x = e
m.z = a
m.t = c
m.w = d
m.u = b
m.s = i
assert b.z.q.o.txt == "m"