class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.u: 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.s: B = None
        self.t: B = None
        self.txt = txt

k = A("k")
a = B("a")
f = C("f")
j = B("j")
l = A("l")

k.x = j
k.s = f
k.u = f
a.v = j
f.s = a
f.t = a
j.v = a
l.x = a
l.s = f
l.u = f
assert j.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.u: 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.s: B = None
        self.t: B = None
        self.txt = txt

k = A("k")
a = B("a")
f = C("f")
j = B("j")
l = A("l")

k.x = j
k.s = f
k.u = f
a.v = j
f.s = a
f.t = a
j.v = a
l.x = a
l.s = f
l.u = f
assert j.v.v.v.v.txt == "j"