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

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

c = A("c")
n = B("n")
j = B("j")
i = B("i")

c.y = i
n.s = c
n.u = c
j.s = c
j.u = c
i.s = c
i.u = c
assert n.u.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

c = A("c")
n = B("n")
j = B("j")
i = B("i")

c.y = i
n.s = c
n.u = c
j.s = c
j.u = c
i.s = c
i.u = c
assert n.u.y.s.txt == "c"