#include <bits/stdc++.h>
#define ll long long
using namespace std;
int T, N, M, S, a, b, s, VezaA[2000005], VezaB[200005], Parent[100005], BrojVeza[100005];
vector <int> KoristimVezu;
bool Okrami[100005];
int ParentCvora(int i){
    while(Parent[i] != i)i = Parent[i];

    return i;
}

int DuzinaPodstabla(int i){
    int Duzina = 0;
    while(Parent[i] != i){
        Duzina++;
        i = Parent[i];
    }
    return Duzina;
}


void Sub1(){
        for(int i = 1; i <= N; i++) Parent[i] = i, Okrami[i] = false, BrojVeza[i] = 0;
        for(int i = 1; i <= S; i++) cin >> s, Okrami[s] = true;
        for(int i = 1; i <= M; i++){
            cin >> VezaA[i] >> VezaB[i];
            a = VezaA[i], b = VezaB[i];
            if(Okrami[a] == true and Okrami[b] == true) continue;
            if(ParentCvora(a) == ParentCvora(b)) continue;
            if(Okrami[a] == true and BrojVeza[a] == 1) continue;
            if(Okrami[b] == true and BrojVeza[b] == 1) continue;

            if(DuzinaPodstabla(a) <= DuzinaPodstabla(b))Parent[a] = b;
            else Parent[a] = b;

            BrojVeza[a]++;
            BrojVeza[b]++;
            KoristimVezu.push_back(i);
        }

        bool SolBool = true;
        for(int i = 1; i <= N; i++) if(BrojVeza[i] == 0 or (Okrami[i] == true and BrojVeza[i] > 1)) SolBool = false;

        if(!SolBool) cout << "-1" << endl;
        else{
            cout << KoristimVezu.size() << endl;
            for(int i = 0; i < KoristimVezu.size(); i++){
                cout << VezaA[KoristimVezu[i]] << " " << VezaB[KoristimVezu[i]] << endl;
            }
        }
    return;
}

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> T;
    while(T--){
        cin >> N >> M >> S;
        if(M == N - 1) Sub1();
    }
return 0;
}