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

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

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

g = A("g")
e = B("e")
m = C("m")
d = A("d")
n = B("n")
i = C("i")
k = C("k")
b = A("b")

g.o = b
g.v = e
g.z = d
e.t = i
m.t = i
m.z = n
m.s = b
d.o = g
d.v = n
d.z = b
n.t = m
i.t = k
i.z = n
i.s = d
k.t = m
k.z = n
k.s = b
b.o = g
b.v = n
b.z = d
assert e.t.z.t.t.s.z.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
m = C("m")
d = A("d")
n = B("n")
i = C("i")
k = C("k")
b = A("b")

g.o = b
g.v = e
g.z = d
e.t = i
m.t = i
m.z = n
m.s = b
d.o = g
d.v = n
d.z = b
n.t = m
i.t = k
i.z = n
i.s = d
k.t = m
k.z = n
k.s = b
b.o = g
b.v = n
b.z = d
assert e.t.z.t.t.s.z.o.o.txt == "b"