AMC 10A/12A 2024 (Problem 15/9)

Let MM be the greatest integer such that both M+1213M+1213 and M+3773M+3773 are perfect squares. What is the units digit of MM?
(A)  1\text{(A)}\;1(B)  2\text{(B)}\;2(C)  3\text{(C)}\;3(D)  6\text{(D)}\;6(E)  8\text{(E)}\;8