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

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

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

a = A("a")
f = B("f")
j = C("j")
e = A("e")
n = C("n")

a.o = f
a.r = j
f.v = a
f.u = j
j.s = f
j.p = n
j.t = n
e.o = f
e.r = j
n.s = f
n.p = j
n.t = j
assert j.t.s.v.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.txt = txt

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

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

a = A("a")
f = B("f")
j = C("j")
e = A("e")
n = C("n")

a.o = f
a.r = j
f.v = a
f.u = j
j.s = f
j.p = n
j.t = n
e.o = f
e.r = j
n.s = f
n.p = j
n.t = j
assert j.t.s.v.o.u.txt == "j"