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

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

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

n = A("n")
f = B("f")
k = C("k")
e = C("e")
d = B("d")

n.o = d
n.s = k
f.v = d
k.o = e
e.o = k
d.v = f
assert e.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.txt = txt

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

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

n = A("n")
f = B("f")
k = C("k")
e = C("e")
d = B("d")

n.o = d
n.s = k
f.v = d
k.o = e
e.o = k
d.v = f
assert e.o.o.o.o.o.txt == "k"