#!/usr/bin/env python3
# NOTA: si raccomanda di usare questo template anche se non lo si capisce completamente.

import sys

# decommenta le due righe seguenti se vuoi leggere/scrivere da file
# sys.stdin = open('input.txt')
# sys.stdout = open('output.txt', 'w')

T = int(input().strip())
for test in range(1, T+1):
    input()
    N, M, K = map(int, input().strip().split())

    G = list(map(int, input().strip().split()))

    A = [0 for i in range(M)]
    B = [0 for i in range(M)]
    for i in range(M):
        A[i], B[i] = map(int, input().strip().split())

    ris = 0


    # INSERISCI IL TUO CODICE QUI


    print("Case #%d: " % test, end='')
    print(ris)

sys.stdout.close()
