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

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

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

m = A("m")
g = B("g")
j = C("j")
i = B("i")
c = A("c")
h = B("h")
b = C("b")
n = C("n")

m.o = n
m.x = n
m.v = n
g.t = j
g.z = c
j.s = c
j.z = h
i.t = n
i.z = c
c.o = b
c.x = b
c.v = j
h.t = n
h.z = m
b.s = c
b.z = h
n.s = c
n.z = i
assert c.x.z.t.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

m = A("m")
g = B("g")
j = C("j")
i = B("i")
c = A("c")
h = B("h")
b = C("b")
n = C("n")

m.o = n
m.x = n
m.v = n
g.t = j
g.z = c
j.s = c
j.z = h
i.t = n
i.z = c
c.o = b
c.x = b
c.v = j
h.t = n
h.z = m
b.s = c
b.z = h
n.s = c
n.z = i
assert c.x.z.t.z.z.txt == "c"