Find the greatest number which divides 285 and 1249 leaving remainders 9 and 7 respectively.