I understand the first part (2^4 is 1 mod 5), but how can you extend this to 2^2^2022?
24≡1(mod5), so 222022≡1(mod5)
You can use modular arithmetic.