Using Distance formula ,
[tex]\bold{d(AB) = \sqrt{ (x_{2} - x_{1}) {}^{2} + ( y_{2} - y_{1}) {}^{2} } }\\ \\\bold{5 = \sqrt{(5 - 1) {}^{2} + (2 - y) {}^{2} }} \\ \\\bold\blue{ squaring \: both \: sides\:,} \\ \\\bold{ 25 = (5 - 1) {}^{2} + (2 - y) {}^{2} }\\ \\\bold{ 25 = (4) {}^{2} + (4 + y {}^{2} - 4y)}\\ \\ \bold{25 = 16 + y {}^{2} - 4y + 4}\\ \\ \bold{25 = y {}^{2} - 4y + 20}\\ \\\bold{ y {}^{2} - 4y - 5 = 0}\\ \\\bold{ y {}^{2} - 5y + y - 5 = 0} \\\\\bold{ y(y - 5) + 1(y - 5) = 0}\\ \\\bold{ (y + 1)(y - 5) = 0 }\\\\\bold{ y = - 1 \: or \: y = + 5}[/tex]
therefore ,
possible coordinates of A are either ( 1 , -1 ) or ( 1 , 5 )
hope helpful~