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

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

b = A("b")
d = B("d")
i = B("i")
f = A("f")
j = B("j")
k = B("k")
l = B("l")

b.v = j
b.y = d
d.z = f
d.t = l
i.z = f
i.t = d
f.v = l
f.y = j
j.z = f
j.t = k
k.z = b
k.t = d
l.z = b
l.t = j
assert f.y.z.y.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.txt = txt

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

b = A("b")
d = B("d")
i = B("i")
f = A("f")
j = B("j")
k = B("k")
l = B("l")

b.v = j
b.y = d
d.z = f
d.t = l
i.z = f
i.t = d
f.v = l
f.y = j
j.z = f
j.t = k
k.z = b
k.t = d
l.z = b
l.t = j
assert f.y.z.y.t.z.txt == "b"