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

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

b = A("b")
c = B("c")
l = A("l")

b.s = c
b.u = c
c.z = l
l.s = c
l.u = c
assert l.u.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.txt = txt

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

b = A("b")
c = B("c")
l = A("l")

b.s = c
b.u = c
c.z = l
l.s = c
l.u = c
assert l.u.z.s.txt == "c"