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

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

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

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

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

m = A("m")
c = B("c")
j = C("j")
d = D("d")
n = E("n")
e = B("e")
g = E("g")
l = B("l")

m.s = j
c.s = d
c.q = d
c.y = m
c.u = e
j.s = l
j.t = d
j.u = d
j.o = g
d.s = e
d.r = m
n.u = m
n.o = d
n.z = g
e.s = d
e.q = d
e.y = m
e.u = l
g.u = m
g.o = d
g.z = n
l.s = d
l.q = d
l.y = m
l.u = e
assert l.y.s.o.u.s.o.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

m = A("m")
c = B("c")
j = C("j")
d = D("d")
n = E("n")
e = B("e")
g = E("g")
l = B("l")

m.s = j
c.s = d
c.q = d
c.y = m
c.u = e
j.s = l
j.t = d
j.u = d
j.o = g
d.s = e
d.r = m
n.u = m
n.o = d
n.z = g
e.s = d
e.q = d
e.y = m
e.u = l
g.u = m
g.o = d
g.z = n
l.s = d
l.q = d
l.y = m
l.u = e
assert l.y.s.o.u.s.o.z.o.txt == "d"