#include<bits/stdc++.h>usingnamespace std;int n, m;
vector<int> A;
vector<int>cal(vector<int>&A,int c){
vector<int> C;for(int i =0, t =0; i < A.size()|| t >0; i ++){
t +=(i < A.size()? A[i]:0)* c;
C.push_back(t %10);
t /=10;}while(C.size()&& C.back()==0) C.pop_back();return C;}intmain(){int T =1;while(cin >> n >> m){if(!n &&!m)break;
A.clear();
A.push_back(1);if(n ==0|| m > n) A[0]=0;elseif(m ==0){// n!for(int i =1; i <= n; i ++) A =cal(A, i);}else{// (n + m)! * (n - 1 + m) / n + 1for(int i =1; i <= n + m; i ++){if(i != n +1) A =cal(A, i);}
A =cal(A, n - m +1);}
cout <<"Test #"<< T ++<<":\n";reverse(A.begin(), A.end());for(auto t : A) cout << t;
cout << endl;}return0;}