import java.math.BigInteger;

public class Coefficients {
	static final int K = 10;
	static BigFraction[][] a = new BigFraction[K + 1][K + 2];

	static {
		a[0][1] = new BigFraction(BigInteger.ONE, BigInteger.ONE);
	}

	public static void main(String[] args) {
		long startTime;
		long endTime;
		long runningTime;
		
		startTime = System.currentTimeMillis();
		for (int k = 0; k <= K; k++) {
			for (int l = k+1; l >= 1; l--) {
				a[k][l] = a(l,k).reduce();
			}
		}
		endTime = System.currentTimeMillis();
		runningTime = endTime - startTime;
		
		System.out.println("B_" + K + " = " + a[K][1]);
		System.out.println("The computation took approximately " + runningTime + " ms.");
	}
	
	public static BigFraction a(int l, int k) {
		if (l >= 2 && l <= k+1) 
			return new BigFraction(BigInteger.valueOf(k), BigInteger.valueOf(l)).multiply(a(l-1,k-1));
		else if (l == 1) {
			BigFraction sum = new BigFraction(BigInteger.ONE, BigInteger.ONE);
			for (int i = 2; i <= k+1; i++) {
				sum = sum.subtract(a(i,k));
			}
			return sum;
		}
		else return new BigFraction(BigInteger.ZERO, BigInteger.ONE);
	}
}