/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    private static long fact1(int a) {
        if (a <= 1) return 1;
        return a * fact1(a - 1);
    }

    private static long fact2(int a) {
        long result = 1;
        while (a > 1) {
        	result *= a;
        	a--;
        }
        return result;
    }

    public static void main(String[] args) {
        System.out.println(fact1(5));
        System.out.println(fact2(5));
    }
}