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

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

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

e = A("e")
i = B("i")
n = C("n")
f = C("f")

e.y = i
e.s = i
e.v = f
i.v = n
n.y = f
n.r = i
f.y = n
f.r = i
assert n.r.v.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.v: C = None
        self.txt = txt

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

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

e = A("e")
i = B("i")
n = C("n")
f = C("f")

e.y = i
e.s = i
e.v = f
i.v = n
n.y = f
n.r = i
f.y = n
f.r = i
assert n.r.v.r.v.txt == "n"