#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 10
#define MAXV 1001
int pwd[MAXN], guess[MAXN], pwd_ord[MAXV], guess_ord[MAXV];
int valid_input(const int &n)
{
int flag;
memset(guess, 0, sizeof(guess));
for(int i = 1; i <= n; i ++) {
scanf("%d", &guess_ord[i]);
guess[ guess_ord[i] ] ++; flag = (guess_ord[i])? 1 : 0;
}
return flag;
}
int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
freopen("test.in", "r", stdin);
#endif
int n, cas(1), a_cnt, b_cnt;
while( scanf("%d", &n) && n ) {
memset(pwd, 0, sizeof(pwd));
for(int i = 1; i <= n; i ++) {
scanf("%d", &pwd_ord[i]); pwd[ pwd_ord[i] ] ++;
}
printf("Game %d:\n", cas ++);
while( valid_input(n) ) {
a_cnt = b_cnt = 0;
for(int i = 1; i <= n; i ++) {
if( pwd_ord[i] == guess_ord[i] ) {
a_cnt ++;
}
}
for(int i = 1; i < MAXN; i ++) {
if( pwd[i] && guess[i] ) {
b_cnt += min(pwd[i], guess[i]);
}
}
printf(" (%d,%d)\n", a_cnt, b_cnt-a_cnt);
}
}
return 0;
}