#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m, k;
bool M[55][55];
const int MOD = 1e9+7;
ll pow_mod(int a, int b){
ll ans = 1;
while (b){
if (b & 1) ans = ((ll)ans*a) % MOD;
a = ((ll)a*a) % MOD;
b >>= 1;
}
return ans;
}
int C(int n, int m){
ll p = 1, q = 1;
while (m){
p = (p*n) % MOD;
q = (q*m) % MOD;
m--;
n--;
}
return (p * pow_mod(q, MOD - 2)) % MOD;
}
inline bool check3(int a, int b, int c){
return (M[a][b] & M[b][c] & M[c][a]) || (!M[a][b] & !M[b][c] & !M[c][a]);
}
inline bool check4(int a, int b, int c, int d){
if ((M[a][b] & M[b][c] & M[c][a]) || (!M[a][b] & !M[b][c] & !M[c][a])) return true;
if ((M[a][b] & M[b][d] & M[d][a]) || (!M[a][b] & !M[b][d] & !M[d][a])) return true;
if ((M[a][c] & M[c][d] & M[d][a]) || (!M[a][c] & !M[c][d] & !M[d][a])) return true;
if ((M[b][c] & M[c][d] & M[d][b]) || (!M[b][c] & !M[c][d] & !M[d][b])) return true;
return false;
}
inline bool check5(int a, int b, int c, int d, int e){
if ((M[a][b] & M[b][c] & M[c][a]) || (!M[a][b] & !M[b][c] & !M[c][a])) return true;
if ((M[a][b] & M[b][d] & M[d][a]) || (!M[a][b] & !M[b][d] & !M[d][a])) return true;
if ((M[a][c] & M[c][d] & M[d][a]) || (!M[a][c] & !M[c][d] & !M[d][a])) return true;
if ((M[b][c] & M[c][d] & M[d][b]) || (!M[b][c] & !M[c][d] & !M[d][b])) return true;
if ((M[e][a] & M[e][b] & M[a][b]) || (!M[e][a] & !M[e][b] & !M[a][b])) return true;
if ((M[e][a] & M[e][c] & M[a][c]) || (!M[e][a] & !M[e][c] & !M[a][c])) return true;
if ((M[e][a] & M[e][d] & M[a][d]) || (!M[e][a] & !M[e][d] & !M[a][d])) return true;
if ((M[e][b] & M[e][c] & M[b][c]) || (!M[e][b] & !M[e][c] & !M[b][c])) return true;
if ((M[e][b] & M[e][d] & M[b][d]) || (!M[e][b] & !M[e][d] & !M[b][d])) return true;
if ((M[e][c] & M[e][d] & M[c][d]) || (!M[e][c] & !M[e][d] & !M[c][d])) return true;
return false;
}
int main(){
int _;
cin>>_;
for(int kase = 1; kase <= _; kase++){
cin >> n >> m;
memset(M, 0, sizeof(M));
while (m--){
int u, v;
cin >> u >> v;
M[u][v] = M[v][u] = 1;
}
int ans = 0;
for (int a = 1; a <= n; a++)
for (int b = a + 1; b <= n; b++)
for (int c = b + 1; c <= n; c++)
ans += check3(a, b, c);
for (int a = 1; a <= n; a++)
for (int b = a + 1; b <= n; b++)
for (int c = b + 1; c <= n; c++)
for (int d = c + 1; d <= n; d++)
ans += check4(a, b, c, d);
for (int a = 1; a <= n; a++)
for (int b = a + 1; b <= n; b++)
for (int c = b + 1; c <= n; c++)
for (int d = c + 1; d <= n; d++)
for (int e = d + 1; e <= n; e++)
ans += check5(a, b, c, d, e);
for (int i = 6; i <= n; i++)
ans = (ans + C(n, i)) % MOD;
printf("Case #%d: %d\n", kase, ans);
}
return 0;
}