{$o+,q-,r-}
uses sysutils, windows;
const MaxN=24;
      


var s:array [1..MaxN] of string;
    a:array ['A'..'Z'] of integer;
    i, j, k, n, o, l, ml, tmp:integer;
    x:array [1..1 shl MaxN - 1] of byte;
    f, mf:array [1..MaxN] of boolean;
    c:char;
    start:integer;


begin
  start:=GetTickCount;
  readln (n);
  for i:=1 to n do readln (s[i]);
  for i:=0 to n-1 do begin
    tmp:=1 shl i;
    for j:=1 to tmp - 1 do x[tmp+j]:=x[j];
    x[tmp]:=i+1;
  end;
  l:=0; ml:=0; o:=0;
  for i:=1 to 1 shl n - 1 do begin
    if GetTickCount-start>1950 then break;
    tmp:=x[i];
    if not f[tmp] then begin
      inc (l); for j:=1 to length (s[tmp]) do begin
        c:=s[tmp][j];
        inc (a[c]); if odd (a[c]) then inc (o) else dec (o);
      end;
    end else begin
      dec (l); for j:=1 to length (s[tmp]) do begin
        c:=s[tmp][j];
        dec (a[c]); if odd (a[c]) then inc (o) else dec (o);
      end;
    end;
    f[tmp]:=not f[tmp];
    if (o=0) and (l>ml) then begin ml:=l; mf:=f end;
  end;
  writeln (ml);
  for i:=1 to n do if mf[i] then write (i, ' '); writeln;
end.