Let M be the greatest integer such that both M+1000 and M+3024 are perfect squares. What is the units digit of M?
2
4
5
7
0