[tex]S_n=a(1+r+\cdots+r^{n-1}+r^n)[/tex]
[tex]rS_n=a(r+r^2+\cdots+r^n+r^{n+1})[/tex]
[tex](1-r)S_n=a(1-r^{n+1})[/tex]
[tex]S_n=a\dfrac{1-r^{n+1}}{1-r}[/tex]
When [tex]|r|<1[/tex], we have
[tex]\displaystyle\lim_{n\to\infty}S_n=\dfrac a{1-r}[/tex]
as is the case here. Since [tex]S=\lim\limits_{n\to\infty}S_n=12[/tex] and [tex]r=\dfrac16[/tex] are given, we can find the first term [tex]a[/tex] immediately:
[tex]12=\dfrac a{1-\frac16}\implies12=\dfrac65a\implies a=10[/tex]