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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

g = A("g")
l = B("l")
f = C("f")
m = A("m")
e = A("e")
i = A("i")
n = B("n")
d = C("d")
c = B("c")

g.u = i
g.s = m
g.q = c
l.w = m
f.z = d
f.y = e
m.u = g
m.s = g
m.q = l
e.u = g
e.s = m
e.q = c
i.u = m
i.s = g
i.q = n
n.w = g
d.z = f
d.y = m
c.w = e
assert i.u.s.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

g = A("g")
l = B("l")
f = C("f")
m = A("m")
e = A("e")
i = A("i")
n = B("n")
d = C("d")
c = B("c")

g.u = i
g.s = m
g.q = c
l.w = m
f.z = d
f.y = e
m.u = g
m.s = g
m.q = l
e.u = g
e.s = m
e.q = c
i.u = m
i.s = g
i.q = n
n.w = g
d.z = f
d.y = m
c.w = e
assert i.u.s.u.q.txt == "n"