#include #include #include #include #include #include using namespace std; const int MOD=1000000007; typedef long long LL; const int maxn=1000100; int f[maxn]; void dit(int id){ int n;scanf("%d",&n);printf("Case #%d:\n%d\n",id,f[n]); } int main() { f[0]=1; for(int i=1;i=2){ LL x=i-1;x=(x*f[i-2])%MOD; f[i]=(f[i]+x%MOD)%MOD; } } int T;scanf("%d",&T); for(int i=1;i<=T;++i)dit(i); }