// phoneT.cc
// phone home problem
// T Feil

#include <math.h>
#include <iostream>
using namespace std;

int n;
int minFreqs, freqsUsed;
int grid[21][21];
int X[21];

void initGrid(int n){
  for(int i=0;i<n;i++)
   for(int j=0;j<n;j++)
    grid[i+1][j+1]=0;
}

double distance(double x1, double y1, double x2, double y2){
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
void getGrid(int n){
 char c;
 int k;
 double x[13], y[13];

 initGrid(n);
 for(int i=1;i<=n;i++)
   cin>>x[i]>>y[i];
 for(int i=1;i<n;i++)
   for(int j=i+1;j<=n;j++)
    if(distance(x[i],y[i],x[j],y[j])<=20)
      grid[i][j]=grid[j][i]=1;
}
 
//true  if OK to color node k  with color
bool OKfreq(int color,int k){
  if(k==1) return true;
  bool OK=true;
  for(int j=1;j<k;j++) //if  k adj to  j, see if j colored with "color"
   if(grid[k][j] && X[j]==color)
    OK=false;
  if(OK && k==n)
   if(grid[k][1])
    OK=(X[1]!=color);
  return OK;
}

int countColors(int n){
  int Colors[n];
  for(int i=0;i<n;i++)
   Colors[i]=0;
  for(int i=1;i<=n;i++)
    Colors[X[i]]++;
  int count=0;
  for(int i=0;i<n;i++)
   if(Colors[i]) count++;
  return  count;
}

void findFreqs(int k){
 for(int i=0;i<minFreqs;i++){
  if(OKfreq(i,k)){ //node k can be freq i
   X[k]=i;
   if(k==n){
    int freqUsed= countColors(n);
    if(freqUsed<minFreqs)
     minFreqs=freqUsed;
   }
   else
    findFreqs(k+1);
  }
 }
}

void printGrid(int n){
  for(int i=1;i<=n;i++){
   for(int j=1;j<=n;j++)
    cout<<grid[i][j];
   cout<<endl;
  }
}

int checkConnect(int n){
  int maxCount=0;
  for(int i=1;i<=n;i++){
    int count =0;
    for(int j=1;j<=n;j++)
      if(grid[i][j]) count++;
    if(count>maxCount) maxCount=count;
  }
  return maxCount;
}

int main(){
 int Case=1;

 cin>>n;
 while(n){
  getGrid(n);
// printGrid(n);
 if(checkConnect(n)>4){
    cout<<"connect >4"<<endl;
    return 0;
  }
  minFreqs=n;
    X[1]=0;
    findFreqs(2);
//for(int i=1;i<=n;i++) cout<<X[i]<<' '; cout<<endl;
  cout<<"The towers in case "<<Case<<" can be covered in "<<
        minFreqs<<" frequencies."<<endl;

  Case++;
  cin>>n;
 }

 return 0;
}
