mc(N, M) :- { N >= 101, M = N-10 }. mc(N, M) :- { N =< 100, T = N+11 }, mc(T, U), mc(U, M).