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

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

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

g = A("g")
j = B("j")
k = C("k")
n = A("n")
e = B("e")

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

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

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

g = A("g")
j = B("j")
k = C("k")
n = A("n")
e = B("e")

g.o = k
j.s = e
k.v = j
n.o = k
e.s = j
assert j.s.s.s.txt == "e"