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

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

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

b = A("b")
i = B("i")
a = C("a")
f = B("f")
l = C("l")

b.s = i
b.z = f
i.u = f
i.w = f
i.x = a
a.t = b
a.y = i
a.z = f
f.u = i
f.w = i
f.x = l
l.t = b
l.y = i
l.z = f
assert b.z.w.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: B = None
        self.txt = txt

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

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

b = A("b")
i = B("i")
a = C("a")
f = B("f")
l = C("l")

b.s = i
b.z = f
i.u = f
i.w = f
i.x = a
a.t = b
a.y = i
a.z = f
f.u = i
f.w = i
f.x = l
l.t = b
l.y = i
l.z = f
assert b.z.w.w.u.txt == "i"