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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
m = C("m")
d = D("d")
f = E("f")
g = B("g")
b = C("b")
a = B("a")

l.w = k
l.q = g
l.o = b
l.y = f
l.v = f
k.r = d
m.r = k
m.t = f
m.z = d
d.w = f
d.o = f
d.s = a
d.q = l
f.u = m
g.r = d
b.r = k
b.t = f
b.z = d
a.r = d
assert m.r.r.s.r.w.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: B = None
        self.o: C = None
        self.y: E = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
m = C("m")
d = D("d")
f = E("f")
g = B("g")
b = C("b")
a = B("a")

l.w = k
l.q = g
l.o = b
l.y = f
l.v = f
k.r = d
m.r = k
m.t = f
m.z = d
d.w = f
d.o = f
d.s = a
d.q = l
f.u = m
g.r = d
b.r = k
b.t = f
b.z = d
a.r = d
assert m.r.r.s.r.w.u.r.txt == "k"