#include <bits/stdc++.h>
#define REP(i,n) for (long long i=0;i<(n);i++)
#define FOR(i,a,b) for (long long i=(a);i<(b);i++)
#define RREP(i,n) for(long long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl
#define dump(x)  cerr << #x << " => " << (x) << endl
#define dumpP(p) cerr << "( " << p.first << " , " << p.second << " )" << ends
#define SORT(c) sort((c).begin(),(c).end())
#define MIN(vec) *min_element(vec.begin(), vec.end())
#define MAX(vec) *max_element(vec.begin(), vec.end())
#define UNIQ(vec) vec.erase(unique(vec.begin(), vec.end()),vec.end()) //ソートの必要あり
#define IN(n,m)  (!(m.find(n) == m.end()))
#define ENUM(m) for (auto itr = m.begin(); itr != m.end(); ++itr)
#define dump_MAP(m) for(auto itr = m.begin(); itr != m.end(); ++itr) { cerr << itr->first << " --> "  << itr->second << endl; }
#define FINDL(vec,x) (lower_bound(vec.begin(),vec.end(),x) - vec.begin())
#define FINDU(vec,x) (upper_bound(vec.begin(),vec.end(),x) - vec.begin())
#define ROUND(N) setprecision(N)
#define ROUND_PRINT(N,val) cout << fixed;cout << setprecision(N) << val << endl
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define INARR(h,w,x,y) (0 <= y && y < h && 0 <= x && x < w)
#define EQ(a,b) (abs(a - b) < 1e-10)
using namespace std;
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {1,0,-1,0};
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
typedef long long LL;
typedef vector<LL> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<LL,LL> pr;
typedef vector<bool> VB;
typedef vector<pr> VP;
struct Order {
  bool operator() (pr const& a,pr const& b) const {
    return a.first > b.first || ((a.first == b.first) && (a.second > b.second));
  }
};

typedef struct _PT {
  long double x, y;
  _PT() {}
  _PT(long double x,long double y) : x(x), y(y) {} 
  _PT operator + (_PT p){
     return _PT(x + p.x, y + p.y);
  }
  _PT operator - (_PT p){
     return _PT(x - p.x, y - p.y);
  }
  _PT operator * (long double d){
     return _PT(d*x, d*y);
  }
  bool operator <(const struct _PT &e) const{
     return (abs(x - e.x) < eps) ? ((y - e.y) < eps) : ((x - e.x) < eps);
  }
  bool operator >(const struct _PT &e) const{
     return (abs(x - e.x) < eps) ? ((y - e.y) > eps) : ((x - e.x) > eps);
  }

  // --オプジェクトは位置ベクトル--

  long double dist(_PT p){ //点pとの距離の2乗
     return (x-p.x)*(x-p.x) + (y-p.y)*(y-p.y);
  }

  // --オブジェクトは幾何ベクトル--
  
  long double dot(_PT v){ //ベクトルvとの内積
     return x * v.x + y * v.y;
  }
  
  long double det(_PT v){ // ベクトルvとの外積
     return x * v.y - v.x * y;
  }

  long double norm(void){ // ベクトルのノルム
    return sqrt(x*x + y*y);
  }

  long double twiceNorm(void){ // ノルムの2乗
    return x*x + y*y;
  }

  bool is_parallel(_PT v) { //ベクトルvと平行か(外積 = 0か)
    return (abs(x * v.y - v.x * y) < eps);
  }
}P;

int main(void) {
    long N,M;
    long double x,y;
    while (1) {
    cin >> N;
    if (N == 0) break;
    cin >> M;
    vector<long double> dis,ang;
    vector<P> e(M);
    REP(i,M) {
      cin >> x >> y;
      e[i] = P(x,y);
    }
    REP(i,M-2) {
      dis.push_back((e[i+1]-e[i]).twiceNorm());
      ang.push_back((e[i+2]-e[i+1]).det(e[i+1]-e[i]));
    }
    dis.push_back((e[M-1]-e[M-2]).twiceNorm());
    VI ans;bool flg1,flg2;
    REP(i,N) {
      vector<P> e2;long M2;
      cin >> M2;
      if (M2 != M) {
        REP(j,M2) cin >> x >> y;
      }
      else {
        REP(j,M) {
          cin >> x >> y;
          e2.push_back(P(x,y));
        }
        flg1 = true;
        REP(j,M-2) {
          if (! EQ(dis[j],(e2[j+1]-e2[j]).twiceNorm())) flg1 = false;
          if (! EQ(ang[j],(e2[j+2]-e2[j+1]).det(e2[j+1]-e2[j]))) flg1 = false;
        }
        if (! EQ(dis[M-2],(e2[M-1]-e2[M-2]).twiceNorm())) flg1 = false;
        flg2 = true;
        REP (j,M-2) {
          if (! EQ(dis[j],(e2[M-j-2]-e2[M-j-1]).twiceNorm())) flg2 = false;
          if (! EQ(ang[j],(e2[M-j-3]-e2[M-j-2]).det(e2[M-j-2]-e2[M-j-1]))) flg2 = false;
        }
        if (! EQ(dis[M-2],(e2[0]-e2[1]).twiceNorm())) flg2 = false;
        if (flg1 || flg2) ans.push_back(i+1);
      }
    }
      REP(i,ans.size()) cout << ans[i] << endl;
      cout << "+++++" << endl; 
    }
}


Measured memory_bytes: 3104