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

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

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

m = A("m")
l = B("l")
i = C("i")
f = C("f")
h = A("h")
e = B("e")
j = C("j")

m.s = h
m.q = h
m.t = e
l.z = h
l.o = m
i.s = e
i.q = h
i.x = f
f.s = e
f.q = h
f.x = j
h.s = m
h.q = m
h.t = e
e.z = h
e.o = h
j.s = l
j.q = h
j.x = f
assert f.s.o.q.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.t: B = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
i = C("i")
f = C("f")
h = A("h")
e = B("e")
j = C("j")

m.s = h
m.q = h
m.t = e
l.z = h
l.o = m
i.s = e
i.q = h
i.x = f
f.s = e
f.q = h
f.x = j
h.s = m
h.q = m
h.t = e
e.z = h
e.o = h
j.s = l
j.q = h
j.x = f
assert f.s.o.q.t.o.t.txt == "e"