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

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

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

e = A("e")
f = B("f")
m = C("m")
b = C("b")
n = A("n")
i = C("i")
l = A("l")

e.o = i
f.t = l
m.y = f
b.y = f
n.o = i
i.y = f
l.o = m
assert n.o.y.t.o.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
m = C("m")
b = C("b")
n = A("n")
i = C("i")
l = A("l")

e.o = i
f.t = l
m.y = f
b.y = f
n.o = i
i.y = f
l.o = m
assert n.o.y.t.o.y.t.txt == "l"