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

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

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

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

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

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

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

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

c.s = b
c.t = g
c.o = g
d.u = e
b.z = c
k.u = e
g.u = c
e.s = b
e.t = g
e.o = m
a.u = e
n.s = b
n.t = k
n.o = k
m.u = n
assert g.u.o.u.s.z.s.txt == "b"