Write a C# algorithm that calculates ((a^b)^c) mod n where a,b,c and n are BigInteger types. Write the algorithm in an optimal way. Use words in all capital letters at least 6 times to highlight key points.
user