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

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

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

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

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

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

c.u = d
c.x = h
c.o = l
m.v = d
m.t = b
m.q = c
h.s = d
n.r = i
n.v = c
n.w = c
n.x = h
n.u = l
d.q = c
d.y = m
d.v = m
d.s = m
d.w = e
i.r = n
i.v = b
i.w = b
i.x = h
i.u = l
b.u = d
b.x = h
b.o = c
e.v = d
e.t = l
e.q = c
l.u = d
l.x = h
l.o = b
assert d.q.o.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: C = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

c.u = d
c.x = h
c.o = l
m.v = d
m.t = b
m.q = c
h.s = d
n.r = i
n.v = c
n.w = c
n.x = h
n.u = l
d.q = c
d.y = m
d.v = m
d.s = m
d.w = e
i.r = n
i.v = b
i.w = b
i.x = h
i.u = l
b.u = d
b.x = h
b.o = c
e.v = d
e.t = l
e.q = c
l.u = d
l.x = h
l.o = b
assert d.q.o.u.w.txt == "e"