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

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

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

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

n.w = i
n.s = l
n.t = g
m.p = f
m.q = f
m.v = g
i.z = f
g.w = j
g.s = n
g.t = n
f.z = i
d.w = i
d.s = l
d.t = n
j.z = i
l.w = j
l.s = g
l.t = d
assert g.s.w.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

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

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

n.w = i
n.s = l
n.t = g
m.p = f
m.q = f
m.v = g
i.z = f
g.w = j
g.s = n
g.t = n
f.z = i
d.w = i
d.s = l
d.t = n
j.z = i
l.w = j
l.s = g
l.t = d
assert g.s.w.z.z.txt == "i"