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

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

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

e = A("e")
b = B("b")
j = C("j")
f = A("f")

e.s = f
e.v = j
b.o = f
j.u = e
f.s = e
f.v = j
assert e.s.v.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: C = None
        self.txt = txt

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

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

e = A("e")
b = B("b")
j = C("j")
f = A("f")

e.s = f
e.v = j
b.o = f
j.u = e
f.s = e
f.v = j
assert e.s.v.u.v.txt == "j"