Since x2+p2y2≡0(mod3), if p=3 then x2+y2≡0(mod3), and consequently x≡y≡0(mod3). Then 9∣x2−3xy+py2 but 9∤12, a contradiction. Thus, p=3 and x2−3xy+9y2=36. Therefore, 3∣x. x=3k, and we get a second order equation k2−ky+y2−4=0. The discriminant Δ=16−3y2=m2. Therefore, y2=0 or y2=4. Solutions are: (−6,0,3), (0,−2,3), (0,2,3), (6,−2,3), (6,0,3), (6,2,3).