not quite sure i understand the problem, but here's one Mathematica approach:
m = {{39, 90, 75, 88, 15, 57},
{9, 2, 58, 68, 48, 64},
{29, 55, 16, 67, 8, 91},
{40, 54, 66, 22, 32, 25},
{49, 1, 17, 41, 14, 30},
{44, 63, 10, 83, 46, 3}};
Select[
Extract[m, #] & /@ Transpose[{Range[6], #}] & /@ Tuples[Range[6], 6],
Total[#] == 419 &]