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

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

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

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

e.v = n
c.u = n
c.o = f
f.s = e
f.y = l
l.v = n
b.v = c
n.u = c
n.o = f
assert l.v.o.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

e.v = n
c.u = n
c.o = f
f.s = e
f.y = l
l.v = n
b.v = c
n.u = c
n.o = f
assert l.v.o.s.v.txt == "n"