```while True:
    try:
        n1 = int(input())
        arr1 = list(input().split())
        n2 = int(input())
        arr2 = list(input().split())
        arr1.append('Invalid')
        tmp = [0]*(n1+1)
        dic = dict(zip(arr1, tmp))
        for i in arr2:
            if i in dic:
                dic[i] += 1
            else:
                dic['Invalid'] += 1
        for k, v in dic.items():
            print(k, ':', v)
    except:
        break