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

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

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

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

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

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

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

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

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

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

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

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

b.s = m
b.v = f
l.o = b
l.q = b
l.u = f
l.r = f
m.w = d
m.z = d
m.p = k
m.q = b
k.s = m
k.x = f
k.q = l
k.v = l
k.w = d
f.o = m
f.s = m
d.s = m
d.x = f
d.q = l
d.v = l
d.w = k
assert f.s.q.s.q.s.txt == "m"