1.

/**
* Angewandte Mathematik, SS11
* Problem: 11115 Uncle Jack
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1866
*
* @author Peter Weismann
* @author Pirmin Schneider
* @version 1.0, 05/01/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.184
*/

import java.math.BigInteger;
import java.util.Scanner;

public class Main {

public static void main (String[] args) {
Scanner input = new Scanner(System.in);
// Anzahl der Neffen
int N;
// Anzahl der CDs
int D;
BigInteger permutations;

while (input.hasNextInt()) {
N = input.nextInt();
D = input.nextInt();

if (N == 0 && D == 0)
break;

// Anzahl aller moeglichen Arten, die CDs zu verteilen
permutations = BigInteger.valueOf(N).pow(D);
System.out.println(permutations);
}
}
}