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

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

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

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

e.v = n
n.p = e
f.o = n
c.o = n
assert e.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

e.v = n
n.p = e
f.o = n
c.o = n
assert e.v.p.v.txt == "n"