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

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

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

g = A("g")
k = B("k")
i = C("i")
j = C("j")
n = B("n")
m = B("m")
l = C("l")
a = C("a")
e = C("e")
f = B("f")

g.s = j
g.t = e
k.z = g
k.q = m
k.x = m
i.r = g
i.t = j
i.z = j
j.r = g
j.t = l
j.z = l
n.z = g
n.q = k
n.x = m
m.z = g
m.q = n
m.x = n
l.r = g
l.t = j
l.z = i
a.r = g
a.t = i
a.z = e
e.r = g
e.t = l
e.z = i
f.z = g
f.q = n
f.x = m
assert m.z.t.z.r.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.txt = txt

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

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

g = A("g")
k = B("k")
i = C("i")
j = C("j")
n = B("n")
m = B("m")
l = C("l")
a = C("a")
e = C("e")
f = B("f")

g.s = j
g.t = e
k.z = g
k.q = m
k.x = m
i.r = g
i.t = j
i.z = j
j.r = g
j.t = l
j.z = l
n.z = g
n.q = k
n.x = m
m.z = g
m.q = n
m.x = n
l.r = g
l.t = j
l.z = i
a.r = g
a.t = i
a.z = e
e.r = g
e.t = l
e.z = i
f.z = g
f.q = n
f.x = m
assert m.z.t.z.r.s.r.txt == "g"