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

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

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

i.v = c
i.s = c
c.q = j
l.q = b
b.v = c
b.s = c
j.v = l
j.s = l
assert i.s.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.txt = txt

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

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

i.v = c
i.s = c
c.q = j
l.q = b
b.v = c
b.s = c
j.v = l
j.s = l
assert i.s.q.v.txt == "l"