#include <stdio.h>

typedef struct line{
  int m;
  int xy[11][2];
}line;

int check_line(line, int[11][2]);

int main(void){

  int n, loop1, loop2, loop3;

  while(1){
    scanf("%d", &n);

    if(n == 0){ 
      break;
    }

    line line0;
    int adjuster;

    scanf("%d", &(line0.m));
    for(loop1 = 0; loop1 < line0.m; loop1++){
      scanf("%d %d", &(line0.xy[loop1][0]), &(line0.xy[loop1][1]));
    }
    while(loop1 < 11){
      line0.xy[loop1][0] = '\0';
      line0.xy[loop1][1] = '\0';
      loop1++;
    }

    adjuster = line0.xy[0][0];
    for(loop1 = 0; loop1 < line0.m; loop1++){
      line0.xy[loop1][0] -= adjuster;
    }
    adjuster = line0.xy[0][1];
    for(loop1 = 0; loop1 < line0.m; loop1++){
      line0.xy[loop1][1] -= adjuster;
    }                                      //adjust line0



    for(loop2 = 0; loop2 < n; loop2++){
      line lineC;
      int cmp[11][2], tmp[11][2], print = 0;

      scanf("%d", &(lineC.m));
      for(loop1 = 0; loop1 < line0.m; loop1++){
	scanf("%d %d", &(lineC.xy[loop1][0]), &(lineC.xy[loop1][1]));
      }
      while(loop1 < 11){
	lineC.xy[loop1][0] = '\0';
	lineC.xy[loop1][1] = '\0';
	loop1++;
      }

      adjuster = lineC.xy[0][0];
      for(loop1 = 0; loop1 < lineC.m; loop1++){
	lineC.xy[loop1][0] -= adjuster;
      }
      adjuster = lineC.xy[0][1];
      for(loop1 = 0; loop1 < lineC.m; loop1++){
	lineC.xy[loop1][1] -= adjuster;
      }                                   //adjust lineC
      

      print += check_line(line0, lineC.xy);
      /*  111
         11 1
            1*/
      for(loop1 = 0; loop1 < 11; loop1++){
	cmp[loop1][0] = cmp[loop1][0] * -1;
	cmp[loop1][1] = cmp[loop1][1] * -1;
      }
      print += check_line(line0, cmp);
      /* 1   
	 1 11 
         111 */


      for(loop1 = 0; loop1 < 11; loop1++){
	tmp[loop1][0] = lineC.xy[loop1][1];
        tmp[loop1][1] = lineC.xy[loop1][0];
      }
      for(loop1 = 0; loop1 < 11; loop1++){
	cmp[loop1][0] = tmp[loop1][0];
	cmp[loop1][1] = tmp[loop1][1];
      }
      /* 111
           1 
	  11
          1 */
      for(loop1 = 0; loop1 < 11; loop1++){
	cmp[loop1][0] = cmp[loop1][0] * -1;
	cmp[loop1][1] = cmp[loop1][1] ;
      }
      print += check_line(line0, cmp);
      /* 111
         1   
	 11
          1 */
      for(loop1 = 0; loop1 < 11; loop1++){
	cmp[loop1][0] = cmp[loop1][0] * -1;
	cmp[loop1][1] = cmp[loop1][1] * -1;
      }
      print += check_line(line0, cmp);
      /*  1 
          11
	   1
         111 */



      for(loop1 = 0; loop1 < 11; loop1++){
	tmp[loop1][0] = cmp[loop1][0];
	tmp[loop1][1] = cmp[loop1][1];
      }
      for(loop1 = lineC.m - 1 ; loop1 >= 0; loop1--){
	cmp[loop1][0] -= tmp[lineC.m - 1][0];
	cmp[loop1][1] -= tmp[lineC.m - 1][1];
      }
      for(loop1 = 0; loop1 < 11; loop1++){
	tmp[loop1][0] = cmp[loop1][0];
	tmp[loop1][1] = cmp[loop1][1];
      }
      for(loop1 = lineC.m - 1, loop3 = 0; loop1 >= 0; loop1--, loop3++){
	cmp[loop3][0] = tmp[loop1][0];
	cmp[loop3][1] = tmp[loop1][1];
      }
      print += check_line(line0, cmp);
      /*  1 
          11
	   1
         111 */
      for(loop1 = 0; loop1 < 11; loop1++){
	cmp[loop1][0] = cmp[loop1][0] * -1;
	cmp[loop1][1] = cmp[loop1][1] * -1;
      }
      print += check_line(line0, cmp);
      /* 111
         1   
	 11
          1 */ 



      for(loop1 = 0; loop1 < 11; loop1++){
	cmp[loop1][0] = lineC.xy[loop1][0];
	cmp[loop1][1] = lineC.xy[loop1][1];
      }
      for(loop1 = lineC.m - 1 ; loop1 >= 0; loop1--){
	cmp[loop1][0] -= lineC.xy[lineC.m - 1][0];
	cmp[loop1][1] -= lineC.xy[lineC.m - 1][1];
      }
      for(loop1 = 0; loop1 < 11; loop1++){
	tmp[loop1][0] = cmp[loop1][0];
	tmp[loop1][1] = cmp[loop1][1];
      }
      for(loop1 = lineC.m - 1, loop3 = 0; loop1 >= 0; loop1--, loop3++){
	cmp[loop3][0] = tmp[loop1][0];
	cmp[loop3][1] = tmp[loop1][1];
      }
      print += check_line(line0, cmp);
      /*  111
         11 1
            1*/
      for(loop1 = 0; loop1 < 11; loop1++){
	cmp[loop1][0] = cmp[loop1][0] * -1;
	cmp[loop1][1] = cmp[loop1][1] * -1;
      }
      print += check_line(line0, cmp);
      /* 1   
	 1 11 
         111 */
      if(print > 0){
	printf("%d\n", loop2+1);
      }



     
    }//lineC
    printf("+++++\n");


  }
  
}

int check_line(line line0, int cmp[11][2]){
  int loop1, check = 0, result = 0;
  for(loop1 = 0; loop1 < line0.m; loop1++){
    if((line0.xy[loop1][0] == cmp[loop1][0]) && (line0.xy[loop1][1] == cmp[loop1][1])) check++;
  }
  if(check == line0.m) result = 1;

  return result;
  
}

/*      scanf("%d", &(line_cmp[loop1].m));
      for(loop2 = 0; loop2 < m; loop2++){
	scanf("%d %d", &(line_cmp[loop1].xy[loop2][0]), &(line_cmp[loop1].xy[loop2][1]));
      }
      while(loop2 < 11){
	line_cmp[loop1].xy[loop2][0] = '\0';
	line_cmp[loop1].xy[loop2][1] = '\0';
	loop2++;
	}*/