#include<iostream>
#include<cstdio>
#include<cmath>
#include<cassert>
#include<climits>
#include<set>
#include<vector>
#include<algorithm>
#include<map>
#include<bitset>
#include<deque>

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define IINF (INT_MAX)
#define MAX 35

using namespace std;

int N,M,dex,limit;
deque<int> ans;
vector<string> LG;
map<string,int> Index;
vector<int> G[MAX];
vector<int> bitG;
set<int> input[MAX];
string country;
bool used[MAX];

void cdfs(int cur,deque<int>& selected){
  if(used[cur])return;
  used[cur] = true;
  //cout << "cur = " << cur << endl;
  for(int i=0;i<G[cur].size();i++){
    int next = G[cur][i];

    if(used[next])continue;

    bool ok = false;
    for(int j=0;j<selected.size();j++){
      int one = selected[j];
      if( ( (bitG[one]>>cur) & 1 ) && ( (bitG[one]>>next) & 1 ) ){
	ok = true;
	break;
      }
    }
    /*
    for(int j=0;j<selected.size();j++){
      int one = selected[j];
      for(int k=j;k<selected.size();k++){
	int two = selected[k];
	if( ( ((bitG[one]>>cur)&1) & ((bitG[two]>>next)&1) ) || ( ((bitG[two]>>cur)&1) & ((bitG[one]>>next)&1) )  ){
	  cout << "from " << cur << " to " << next << " is ok because they have " << LG[one] << " and " << LG[two] << endl;
	  ok = true;
	  goto Skip;
	}
      }
    }
  Skip:;
    */
    if(ok){
      //cout << "from " << cur << " to " << next << endl;
      cdfs(next,selected);
    }
  }
}


bool check(deque<int>& selected){
  for(int i=0;i<M;i++)used[i] = false;

  int OK = bitG[selected[0]];
  while(OK){
    int use = OK & -OK;
    int cur = log2(use);
    OK -= use;
    cdfs(cur,selected);
  }

  for(int i=0;i<M;i++)if(!used[i])return false;
  return true;
}

void dfs(int cur,int language,int student,deque<int>& selected){

  if(language >= limit || language >= 6){
    return;
  }

  if(student == (1<<M)-1){
    if(!check(selected))return;
    if(limit > language){
      limit = language;
      ans = selected;
    }
    return;
  }

  for(int i=cur;i<N;i++){
    selected.push_back(i);
    dfs(i+1,language+1,student|bitG[i],selected);
    selected.pop_back();
  }

}


int main(){

  bool first = true;
  while(cin >> N >> M,N|M){

    if(!first)puts("");
    first = false;

    //init
    LG.clear();
    dex = 0;
    Index.clear();
    bitG.clear();
    ans.clear();
    for(int i=0;i<max(N,M);i++){
      G[i].clear();
      input[i].clear();
    }
     
    bitG.resize(N,0);

    for(int i=0;i<N;i++){
      cin >> country;
      LG.push_back(country);
      Index[country] = dex++;
    }

    int k;
    for(int i=0;i<M;i++){
      cin >> k;
      for(int j=0;j<k;j++){
	cin >> country;
	int index = Index[country];
	input[i].insert(index);
	bitG[index] |= (1<<i);
      }
    }

    //make graph
    for(int i=0;i<M;i++){
      for(int j=i+1;j<M;j++){
	for(set<int>::iterator it = input[i].begin(); it != input[i].end(); it++){
	  int value = *it;
	  if(input[j].find(value) != input[j].end()){
	    G[i].push_back(j);
	    G[j].push_back(i);
	  }
	}
      }
    }
    /*    
    rep(i,N){
      bitset<10> state = bitG[Index[LG[i]]];
      cout << LG[i] << " = " << Index[LG[i]] << " " << state << endl;
    }

    deque<int> deq;
    deq.push_back(0);
    deq.push_back(1);
    deq.push_back(3);
    deq.push_back(5);
    cout << check(deq) << endl;
    */
    limit = IINF;
    deque<int> deq;
    dfs(0,0,0,deq);

    if(limit == IINF){
      cout << "Impossible" << endl;
    } else {
      cout << limit << endl;
      for(int i=0;i<limit;i++){
	cout << LG[ans[i]] << endl;
      }
    }


  }
  return 0;
}