#include #define mo 1000000007 int f[1000005]; int main() { f[0]=1;f[1]=1; for (int i=2;i<=1000000;i++)f[i]=(f[i-1]+(i-1ll)*f[i-2])%mo; int n;scanf("%d",&n); for (int i=1;i<=n;i++){ int x;scanf("%d",&x); printf("Case #%d:\n%d\n",i,f[x]); } return 0; }