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.z: A = None
        self.u: A = None
        self.txt = txt

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

d.v = b
d.s = i
j.z = d
j.u = d
c.v = j
c.s = j
b.z = d
b.u = c
l.z = d
l.u = d
i.z = c
i.u = c
assert i.z.v.u.s.u.s.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.z: A = None
        self.u: A = None
        self.txt = txt

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

d.v = b
d.s = i
j.z = d
j.u = d
c.v = j
c.s = j
b.z = d
b.u = c
l.z = d
l.u = d
i.z = c
i.u = c
assert i.z.v.u.s.u.s.txt == "j"