#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i,n) for(i=0;i<n;++i)
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define mp make_pair
#define pb push_back
#define fi first
#define sc second

int main(int argc, char const *argv[]) {
  int i,j;
  double eps=1e-10;
  while(1){
    int n;
    cin >>n;
    if(n==0) break;

    vector<double> x(n),y(n);
    rep(i,n) scanf(" %lf,%lf", &x[i], &y[i]);

    int ans=0;
    rep(i,n){//i?????????????????????????????¨????????£??????????????°??????
      int tmp=0;
      printf("%d :",i);
      rep(j,n){
        double dist=pow(x[i]-x[j],2)+pow(y[i]-y[j],2);
        if(dist<4.0+eps){
          ++tmp;
          printf(" %d",j);
        }
      }
      printf("\n");
      ans=max(ans,tmp);
    }

    std::cout << ans << std::endl;
  }
  return 0;
}