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

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

l = A("l")
f = B("f")
m = A("m")
c = B("c")
i = A("i")
n = B("n")
k = A("k")
b = B("b")
a = B("a")

l.v = i
f.y = b
m.v = k
c.y = b
i.v = m
n.y = f
k.v = m
b.y = a
a.y = c
assert f.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

l = A("l")
f = B("f")
m = A("m")
c = B("c")
i = A("i")
n = B("n")
k = A("k")
b = B("b")
a = B("a")

l.v = i
f.y = b
m.v = k
c.y = b
i.v = m
n.y = f
k.v = m
b.y = a
a.y = c
assert f.y.y.y.txt == "c"