public class ModularExp {
    /* Reads 3 long command-line arguments, b, e and n,
    *  and prints b^e (mod n). Also measures the time
    *  elapsed to perform this computation.
    *  Example execution: ModularExp base exponent n
    */
    public static void main(String[] args) {
        long base = Long.parseLong(args[0]);
        long exponent = Long.parseLong(args[1]);
        long n = Long.parseLong(args[2]);
        Stopwatch watch = new Stopwatch(); // Start measuring time

        long result = 1;
        for (int i = 0; i < exponent; i++) {
            // Fill in
        }
        // Print result of modular exponentiation
        System.out.println(base + "^{" + exponent + "} (mod " + n + ") = " + result);
        // Stop measuring and print elapsed time
        System.out.println("Elapsed time: " + watch.elapsedTime() + " sec.");
    }
}