Finding common ratio and first term