From the question it is given that,
First term of a G.P. is a =
The sum of first three terms is S3 =
We know that,
By cross multiplication we get,
Transposing 31 from right hand side to left hand side it becomes
,
Take
Therefore, common ratio
.