Powers of 7 have their units place cycling between 7, 9, 3 & 1 in that respective order. This means 7^(multiple of 4) will have its ending digit as 1.

now (closest number to 777 and multiple of 4) is 776

7^777 = 7^776 x 7

This means the number 7^777 will have 7 as its ending digit.

Similarly

777^777 = (7x111)^777 => (7x3x37)^777 => 7^777 x 3^777 x 37^777

Powers of 3 have their units place cycling between 3, 9, 7 & 1 in that respective order.

Powers of 37 have their units place cycling between 7, 9, 3 & 1 in that respective order.

777^777 = (7x111)^777=> 7^777(Last digit is 7) x 3^777(Last digit is 3) x 37^777(Last digit is 7) ==> 7{last digit of 7x3x7}.