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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

e = A("e")
f = B("f")
k = C("k")
b = D("b")
l = E("l")
m = C("m")
h = D("h")
g = B("g")

e.r = m
e.w = h
f.s = g
f.r = l
f.q = m
k.x = l
k.w = e
k.s = m
k.z = m
k.o = f
b.q = l
b.o = k
l.y = e
m.x = l
m.w = e
m.s = k
m.z = k
m.o = g
h.q = l
h.o = k
g.s = f
g.r = l
g.q = m
assert b.o.x.y.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

e = A("e")
f = B("f")
k = C("k")
b = D("b")
l = E("l")
m = C("m")
h = D("h")
g = B("g")

e.r = m
e.w = h
f.s = g
f.r = l
f.q = m
k.x = l
k.w = e
k.s = m
k.z = m
k.o = f
b.q = l
b.o = k
l.y = e
m.x = l
m.w = e
m.s = k
m.z = k
m.o = g
h.q = l
h.o = k
g.s = f
g.r = l
g.q = m
assert b.o.x.y.w.q.txt == "l"