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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
d = B("d")
m = C("m")
f = B("f")
l = C("l")
c = A("c")
k = A("k")
i = A("i")
a = C("a")

n.q = m
n.t = f
d.s = l
d.y = l
d.w = m
m.v = i
m.z = d
m.q = c
f.s = m
f.y = m
f.w = l
l.v = n
l.q = n
l.z = f
c.q = l
c.t = d
k.q = a
k.t = d
i.q = m
i.t = f
a.v = c
a.z = d
a.q = k
assert i.q.z.w.v.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
d = B("d")
m = C("m")
f = B("f")
l = C("l")
c = A("c")
k = A("k")
i = A("i")
a = C("a")

n.q = m
n.t = f
d.s = l
d.y = l
d.w = m
m.v = i
m.z = d
m.q = c
f.s = m
f.y = m
f.w = l
l.v = n
l.q = n
l.z = f
c.q = l
c.t = d
k.q = a
k.t = d
i.q = m
i.t = f
a.v = c
a.z = d
a.q = k
assert i.q.z.w.v.t.s.txt == "m"