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

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

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

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

a.s = j
a.y = j
a.t = j
j.y = a
f.r = a
f.u = a
f.x = j
e.r = a
e.u = a
e.x = j
assert f.r.y.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.t: B = None
        self.txt = txt

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

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

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

a.s = j
a.y = j
a.t = j
j.y = a
f.r = a
f.u = a
f.x = j
e.r = a
e.u = a
e.x = j
assert f.r.y.y.t.txt == "j"