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

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

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

e = A("e")
m = B("m")
i = C("i")
f = A("f")
l = A("l")
g = B("g")
a = C("a")

e.z = l
e.o = i
m.u = g
m.y = i
m.o = l
i.r = g
i.s = g
f.z = e
f.o = a
l.z = e
l.o = a
g.u = m
g.y = i
g.o = e
a.r = g
a.s = g
assert e.o.s.y.s.o.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: C = None
        self.txt = txt

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

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

e = A("e")
m = B("m")
i = C("i")
f = A("f")
l = A("l")
g = B("g")
a = C("a")

e.z = l
e.o = i
m.u = g
m.y = i
m.o = l
i.r = g
i.s = g
f.z = e
f.o = a
l.z = e
l.o = a
g.u = m
g.y = i
g.o = e
a.r = g
a.s = g
assert e.o.s.y.s.o.z.o.txt == "a"