Whenever you see this type of question then use this method to solve this.
5^1 = 5 //Not divisible by 77, so go on increasing power of 5
5^2 = 25 //Not divisible by 77, so go on increasing power of 5
5^3 = 125 //Divisible by 77 but return remainder 48, which is a huge number. Our objective is to get as less remainder as possible.
5^4 = 625 // Divisible by 77, and remainder is 9. It is pretty less, then stop here.
Now 5^13 = ((5^4)*(5^4)*(5^4)*5)%77
= (9 * 9 * 9 * 5) %77
= (729 * 5) %77
= (36 * 5) % 77 // 729%77 = 36
= 180 % 77 = 26
Hence 26 will be the answer.