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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: A = None
        self.y: A = None
        self.t: D = None
        self.txt = txt

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

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

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

m = A("m")
d = B("d")
k = C("k")
l = D("l")
i = E("i")
h = E("h")
n = B("n")
f = C("f")
a = A("a")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: A = None
        self.y: A = None
        self.t: D = None
        self.txt = txt

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

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

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

m = A("m")
d = B("d")
k = C("k")
l = D("l")
i = E("i")
h = E("h")
n = B("n")
f = C("f")
a = A("a")

m.s = k
d.q = h
d.p = a
d.y = m
d.t = l
k.u = m
l.r = k
l.x = k
l.z = i
l.s = n
l.y = n
i.r = k
i.y = k
i.p = h
i.s = h
h.r = f
h.y = k
h.p = i
h.s = i
n.q = i
n.p = m
n.y = m
n.t = l
f.u = m
a.s = k
assert d.q.y.u.s.u.s.u.s.txt == "k"