#include <cstdio>
#include <vector>

using namespace std;
#define Nmax 8
int N;
int ts[8][2]={{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,-1},{2,1}};

struct plansza {bool P[Nmax][Nmax];
  bool operator==(const plansza &P);
  bool equals(plansza P);
  plansza  symH();
  plansza  rot90();
  plansza  rot180();
  }P0;
vector<plansza> tp;
bool W[Nmax];
plansza P;

void show(const plansza &P);
bool ss(int w, int k);

void uws(int w, int k) {
  if (W[w]) return;
  if (!ss(w,k)) return;
  W[w]=true;
  P.P[w][k]=true;
  if (k==N-1) {
    bool same=false;
    for (int i=0;!same && i<tp.size();++i)  same=tp[i].equals(P);
    if (!same) 
      tp.push_back(P); 
    }
  else
    for (int i=0;i<N;++i) uws(i,k+1);
  W[w]=false;
  P.P[w][k]=false;
  }

int main() {
for (N=1;N<=Nmax;++N) {
  tp.clear();
  P=P0;
  for (int i=0;i<N;++i)    
    uws(i,0);
  printf("%d\t%d\n",N,tp.size());
  //for(int i=0;i<tp.size();++i) {printf("%d\n",i);show(tp[i]);}
  }
return 0;
}

void show(const plansza &P) {
  for (int i=0;i<N;++i) { 
    for (int j=0;j<N;++j)
      printf("%c",P.P[i][j]?'X':'o');
    printf("\n");
    }
  printf("\n");
  }

bool ss(int w, int k) {
  bool ok=true;    
  for (int i=0;ok && i<8;++i) {
    int x=w+ts[i][0];    if (x<0 || x>N-1) continue;
    int y=k+ts[i][1];    if (y<0 || y>N-1) continue;
    ok=!P.P[x][y];
    }
  return ok;    
  }

bool plansza::operator==(const plansza &Q) {
  bool ok=true;    
  for (int i=0;ok && i<N;++i)
    for (int j=0;ok &&j<N;++j)
      ok=P[i][j]==Q.P[i][j];
  return ok;    
  }

plansza plansza::symH() {
  plansza P=*this;
  for (int i=0;i<N;++i)
    for (int j=0;j<(N+1)/2;++j) {
      bool p=P.P[i][j];
      P.P[i][j]=P.P[i][N-1-j];
      P.P[i][N-1-j]=p;
      }
  return P;      
  };
  
plansza plansza::rot90() {
  plansza Q;
  for (int i=0;i<N;++i)
    for (int j=0;j<N;++j)
       Q.P[j][N-1-i]=P[i][j];
  return Q;
  }

plansza plansza::rot180() {
  plansza Q;
  for (int i=0;i<N;++i)
    for (int j=0;j<N;++j)
       Q.P[N-1-i][N-1-j]=P[i][j];
  return Q;
  }

bool plansza::equals(plansza P) {
    if (*this==P.rot90())  return true;
    if (*this==P.rot180())  return true;
    if (P==this->rot90())  return true;
    if (*this==P.symH())  return true;
    P=P.symH();
    if (*this==P.rot90())  return true;
    if (*this==P.rot180())  return true;
    if (P==this->rot90())  return true;
    return false;
    }
