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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.w: B = None
        self.u: E = None
        self.o: C = None
        self.txt = txt

m = A("m")
n = B("n")
k = C("k")
e = D("e")
f = E("f")
l = C("l")
g = E("g")
c = B("c")

m.w = k
m.y = l
m.p = f
n.s = m
n.q = e
k.q = m
k.s = l
e.w = m
f.t = g
f.u = g
f.r = c
f.w = c
f.o = l
l.q = m
l.s = k
g.t = f
g.u = f
g.r = n
g.w = c
g.o = k
c.s = m
c.q = e
assert k.q.y.s.s.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.w: B = None
        self.u: E = None
        self.o: C = None
        self.txt = txt

m = A("m")
n = B("n")
k = C("k")
e = D("e")
f = E("f")
l = C("l")
g = E("g")
c = B("c")

m.w = k
m.y = l
m.p = f
n.s = m
n.q = e
k.q = m
k.s = l
e.w = m
f.t = g
f.u = g
f.r = c
f.w = c
f.o = l
l.q = m
l.s = k
g.t = f
g.u = f
g.r = n
g.w = c
g.o = k
c.s = m
c.q = e
assert k.q.y.s.s.s.q.txt == "m"