#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int t, n, m, s, x, minimum;
struct grana{
    int cvorOd, cvorDo;
}pom;
vector <int> trazeni;
int brUlaznihGrana[100005];
bool smeSeObrisati[200005];
vector <grana> grane;
vector <int> povezani[200005];
void mozeLiSeObrisati(bool smeSeObrisati[], int brUlaznihGrana[]){
    for(int i = 1; i <= n; i++){
        if(--brUlaznihGrana[i] == 0)
            smeSeObrisati[i] = false;
        else
            smeSeObrisati[i] = true;
    }
}
bool legalno(){
    int br = 0;
    for(int i = 1; i <= n; i++){
        if(brUlaznihGrana[i] == 1)
            br++;
    }
    if(br % 2 == 0)
        return false;
    else
        return true;
}
void sklanjanje(int idx, int tren){
    if(idx == m + 1)
        return;
    if(!smeSeObrisati[idx])
        int nbt;
    else{
        brUlaznihGrana[grane[idx].cvorOd]--;
        brUlaznihGrana[grane[idx].cvorDo]--;
        if(legalno()){
            minimum = min(minimum, tren - 1);
            smeSeObrisati[idx] = false;
            sklanjanje(idx + 1, tren - 1);
        }
        else{
            brUlaznihGrana[grane[idx].cvorOd]++;
            brUlaznihGrana[grane[idx].cvorDo]++;
        }
        smeSeObrisati[idx] = true;
        //sklanjanje(idx + 1, tren);
    }
    sklanjanje(idx + 1, tren);
    return;
}

int main(){
    cin >> t;
    while(t--){
        cin >> n >> m >> s;
        minimum = m;
        trazeni.clear();
        grane.clear();
        for(int i = 1; i <= n; i++)
            brUlaznihGrana[i] = 0;
        for(int i = 1; i <= n; i++)
            smeSeObrisati[i] = true;
        for(int i = 1; i <= n; i++){
            while(povezani[i].size())
                povezani[i].pop_back();
        }
        while(s--){
            cin >> x;
            trazeni.push_back(x);
        }
        for(int i = 1; i <= m; i++){
            cin >> pom.cvorOd >> pom.cvorDo;
            brUlaznihGrana[pom.cvorOd]++;
            brUlaznihGrana[pom.cvorDo]++;
            grane.push_back(pom);
            povezani[pom.cvorOd].push_back(pom.cvorDo);
            povezani[pom.cvorDo].push_back(pom.cvorOd);
        }
        if(m == n - 1){
            bool ima = false;
            for(int i = 0; i < trazeni.size(); i++){
                if(brUlaznihGrana[trazeni[i]] > 1){
                    cout << -1 << endl;
                    ima = true;
                    break;
                //cout << i << " " << povezani[i][0] << endl;
                }
            }
            if(!ima){
            cout << grane.size() << endl;
            for(int i = 0; i < m; i++)
                cout << grane[i].cvorOd << " " << grane[i].cvorDo << endl;}
        }
        //else{
            mozeLiSeObrisati(smeSeObrisati, brUlaznihGrana);
            cout << "---------------" << endl;
            for(int i = 1; i <= n; i++){
                if(!smeSeObrisati[i])
                    cout << i << " " << povezani[i][0] << endl;
            }
            cout << "---------------" << endl;
            /*for(int i = 1; i <= n; i++)
            cout << grane[i - 1].cvorOd << ' ' << grane[i - 1].cvorDo << endl;*/
       // }
       sklanjanje(1, 1);
       cout << "minimum " << minimum << endl;
    }
    return 0;
}