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

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

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

e = A("e")
i = B("i")
f = C("f")
c = B("c")
a = B("a")
g = A("g")
j = C("j")
h = C("h")
m = A("m")

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

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

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

e = A("e")
i = B("i")
f = C("f")
c = B("c")
a = B("a")
g = A("g")
j = C("j")
h = C("h")
m = A("m")

e.z = a
e.s = j
e.u = j
i.o = f
i.x = m
i.z = e
f.o = j
f.q = m
c.o = f
c.x = g
c.z = g
a.o = h
a.x = e
a.z = m
g.z = a
g.s = f
g.u = j
j.o = h
j.q = m
h.o = j
h.q = e
m.z = i
m.s = h
m.u = j
assert h.o.o.q.txt == "e"