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

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

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

c = A("c")
m = B("m")
h = C("h")
f = C("f")
l = B("l")
e = A("e")
j = C("j")
g = A("g")
d = C("d")
a = B("a")

c.z = g
c.v = l
m.s = j
m.t = l
h.v = m
h.w = g
h.u = c
f.v = a
f.w = e
f.u = g
l.s = f
l.t = a
e.z = g
e.v = m
j.v = l
j.w = g
j.u = e
g.z = c
g.v = l
d.v = a
d.w = c
d.u = g
a.s = j
a.t = m
assert a.s.w.z.z.z.v.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.txt = txt

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

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

c = A("c")
m = B("m")
h = C("h")
f = C("f")
l = B("l")
e = A("e")
j = C("j")
g = A("g")
d = C("d")
a = B("a")

c.z = g
c.v = l
m.s = j
m.t = l
h.v = m
h.w = g
h.u = c
f.v = a
f.w = e
f.u = g
l.s = f
l.t = a
e.z = g
e.v = m
j.v = l
j.w = g
j.u = e
g.z = c
g.v = l
d.v = a
d.w = c
d.u = g
a.s = j
a.t = m
assert a.s.w.z.z.z.v.t.t.txt == "m"