answered 7 years ago
Change the variable in your third loop from i to, say, k. The variable i is supposed to be a subset of m.
i
k
m