1.
/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS09
* Problem: 10007 Count the Trees
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=948
*
* @author Christoph Hausmann
* @version 0.1, 12/09/2009
*
* Method : Catalan
* Status : Accepted
* Runtime: 0.444
*/

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;


public class CountTheTrees_10007 {
public static void main(String... args) throws NumberFormatException, IOException {
final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

while(true) {
final int numElements = Integer.parseInt(br.readLine());

if(numElements == 0)
return;

System.out.println(catalan(numElements).multiply(fac(numElements)));
}
}



private static BigInteger catalan(int numElements) {
return fac(numElements*2).divide(fac(numElements+1).multiply(fac(numElements)));
}



private static BigInteger fac(int n) {
BigInteger res = BigInteger.ONE;

for(int i = 1; i <= n; i++)
res = res.multiply(BigInteger.valueOf(i));

return res;
}
}