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

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

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

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

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

k = A("k")
a = B("a")
f = C("f")
m = D("m")
c = E("c")
i = E("i")
l = A("l")

k.s = a
k.r = a
k.x = a
k.q = a
k.p = f
a.u = f
f.y = l
m.u = c
c.q = i
c.y = m
c.s = m
c.x = f
i.q = c
i.y = m
i.s = m
i.x = f
l.s = a
l.r = a
l.x = a
l.q = a
l.p = f
assert m.u.q.s.u.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: B = None
        self.x: B = None
        self.p: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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

k = A("k")
a = B("a")
f = C("f")
m = D("m")
c = E("c")
i = E("i")
l = A("l")

k.s = a
k.r = a
k.x = a
k.q = a
k.p = f
a.u = f
f.y = l
m.u = c
c.q = i
c.y = m
c.s = m
c.x = f
i.q = c
i.y = m
i.s = m
i.x = f
l.s = a
l.r = a
l.x = a
l.q = a
l.p = f
assert m.u.q.s.u.q.y.txt == "m"