#include int a[26]; int s[26][26]; int r[26]; int as,i,j,found; struct {int xmin,xmax,ymin,ymax;} g[26]; int main() { int count; FILE *inp = fopen("slides.in","r"); count = 1; while(1) { fscanf(inp,"%d\n",&as); if (as == 0) break; for (i=0;i x)&&(g[j].ymin <= y)&&(g[j].ymax > y)) { s[j][i]=1;a[j]++; } else { s[j][i] = 0; } } } found = -1; for (i=0; i < as; i++) if(a[i] == 1) found = i; while(found >= 0) { for(i=0;i < as;i++) { if (s[found][i]>0) { for(j=0;j