Simon and greg shared pencils in the ratio 7:5. if simon gives away 30 pencils and greg gets 30 more pencils, they will have the same number of pencils. how many did each of them have in the beginning?