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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

e = A("e")
b = B("b")
n = C("n")
h = D("h")
f = E("f")
m = D("m")

e.q = n
e.p = b
e.w = b
e.y = m
e.v = f
b.q = m
n.o = b
n.x = m
n.s = m
n.y = e
n.v = e
h.o = m
h.s = e
h.v = n
f.u = b
f.p = b
f.o = b
f.r = n
f.v = e
m.o = h
m.s = e
m.v = n
assert e.w.q.s.v.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.w: B = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

e = A("e")
b = B("b")
n = C("n")
h = D("h")
f = E("f")
m = D("m")

e.q = n
e.p = b
e.w = b
e.y = m
e.v = f
b.q = m
n.o = b
n.x = m
n.s = m
n.y = e
n.v = e
h.o = m
h.s = e
h.v = n
f.u = b
f.p = b
f.o = b
f.r = n
f.v = e
m.o = h
m.s = e
m.v = n
assert e.w.q.s.v.o.q.txt == "m"