A triangle has a perimeter of 31. The longest side is equal to 12. The difference of the other two is 3. What is length of the shortest side ?