#include<iostream>
#include<vector>
#include<map>
#include<stack>
#include<algorithm>
#include<queue>
#include<list>
#include<set>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stdio.h>
#include<ctype.h>
#include<iomanip>
using namespace std;
#define LL long long
#define pi acos(-1)
#define N 50010
#define INF 9999999999
#define eps 1e-8
struct line
{
double x1,y1,x2,y2;
bool ok;
}p[100010];
int ans[1100];
bool fuck(line a,line b)///判两线段是否相交,4次叉乘///
{
double s1=(a.x2-a.x1)*(b.y1-a.y1)-(a.y2-a.y1)*(b.x1-a.x1);double s2=(a.x2-a.x1)*(b.y2-a.y1)-(a.y2-a.y1)*(b.x2-a.x1);
double s3=(b.x2-b.x1)*(a.y1-b.y1)-(b.y2-b.y1)*(a.x1-b.x1);double s4=(b.x2-b.x1)*(a.y2-b.y1)-(b.y2-b.y1)*(a.x2-b.x1);
if(s1*s2<=0 && s3*s4<=0)
return false;
else
return true;
}
int main()
{
// freopen("a.txt","r",stdin);
int n;
while(scanf("%d",&n) && n)
{
int i,j,k;
for(i=1;i<=n;i++)
scanf("%lf%lf%lf%lf",&p[i].x1,&p[i].y1,&p[i].x2,&p[i].y2);
p[n].ok=true;
int cnt=1;
for(i=n-1;i>=1;i--)
{
p[i].ok=true;
for(j=i+1;j<=n;j++)
if(!fuck(p[i],p[j]))
{
p[i].ok=false;
break;
}
if(p[i].ok)
ans[cnt++]=i;
}
ans[0]=n;
printf("Top sticks:");
for(i=cnt-1;i>=0;i--)
{
printf(" %d",ans[i]);
if(i!=0)
printf(",");
if(i==0)
printf(".\n");
}
}
return 0;
}