#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll qpow(ll a, ll b, ll m)
{
    ll r = 1;
    for (; b; b >>= 1, a = a * a % m)
        if (b & 1)
            r = r * a % m;
    return r;
}
int main()
{
    int T, n;
    scanf("%d", &T);
    for (int t = 1; t <= T; t++)
        scanf("%d", &n), printf("Case #%d: %lld\n", t, n * qpow(2, n - 1, 1000000007) % 1000000007);
    return 0;
}
