public class Dwa {

static int max_n = 200;

static int n;

static boolean [][]e = new boolean[max_n][max_n];

static boolean []inGraph = new boolean[max_n];

static boolean []solution = new boolean[max_n];

public static void main(String[] args){

int d = 0;

int v = 0;

StreamTokenizer strTok = new StreamTokenizer(

new BufferedReader(

new InputStreamReader(System.in)

)

);

try {

strTok.nextToken();

n = (int)strTok.nval;

for(int i = 0; i < n; i++){

for(int j = 0; j < n; ++j){

e[i][j] = false;

}

strTok.nextToken();

d = (int)strTok.nval;

for(int j = 0; j < d; ++j){

strTok.nextToken();

v = (int)strTok.nval;

e[i][v-1] = true;

}

}

} catch (IOException e) {

System.err.println("Input Stream ERROR");

}

for(int i = 0; i < n; i++){

inGraph[i] = true;

}

for(int i = 0; i < n; ++i){

solution[i] = false;

}

solve();

write();

}

static void solve(){

int k = 0;

int neighbors = 0;

int []who = new int[max_n];

for(k = 0; k < n; ++k){

if(inGraph[k]){

neighbors = 0;

for(int j = 0; j < n; ++j){

if(inGraph[j] && e[k][j]){

who[neighbors++] = j;

}

}

if(neighbors % 2 == 1){

break;

}

}

}

if(k == n){

return;

}

inGraph[k] = false;

for(int i = 0; i < neighbors; ++i){

for(int j = 0; j < neighbors; ++j){

if(i != j){

e[who[i]][who[j]] = !e[who[i]][who[j]];

}

}

}

solve();

int party = 0;

for(int i = 0; i < neighbors; ++i){

if(solution[who[i]]){

++party;

}

}

solution[k] = party % 2 == 0;

}

static void write(){

int count = 0;

for(int i = 0; i < n; ++i){

if(solution[i]){

++count;

}

}

System.out.println(count);

for(int i = 0; i < n; ++i){

if(solution[i]){

System.out.print(i+1+" ");

}

}

System.out.println();

}

}