#include #include #include #include #include #define rep(i,j,k) for(i=j;i<=k;i++) #define rrep(i,j,k) for(i=j;i>=k;i--) using namespace std; int n,i,x,ans,k,o,T; long long f[1000011]; int main(){ cin>>T; f[1]=1;f[2]=2; rep(i,3,1000001) f[i]=(f[i-1]+f[i-2]*(i-1))%1000000007; rep(o,1,T){ scanf("%d",&n); printf("Case #%d:\n",o); cout<