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

#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF INT_MAX/3
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cout<<#x<<":"<<x<<endl
#define debug2(x,y) cout<<#x<<","<<#y":"<<x<<","<<y<<endl
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }

template<typename T> ostream& operator<<(ostream& os,const pair<T,T>& p){
    os<<"{"<<p.first<<","<< p.second<<"}";
}

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

int mat[2][2];

bool same(const vector<pii> &line1,vector<pii> &line2){
    if(line1.size()!=line2.size()) return false;

    int m = line2.size();
    int vx = line2[1].first - line2[0].first;
    int vy = line2[1].second - line2[0].second;


    // ???????????????????????????????????????
    if(vx==0 && vy>0){
        mat[0][0]=1;
        mat[0][1]=0;
        mat[1][0]=0;
        mat[1][1]=1;
    }else if(vx==0 && vy<0){
        mat[0][0]=-1;
        mat[0][1]=0;
        mat[1][0]=0;
        mat[1][1]=-1;
    }else if(vx>0 && vy==0){
        mat[0][0]=0;
        mat[0][1]=-1;
        mat[1][0]=1;
        mat[1][1]=0;
    }else if(vx<0 && vy==0){
        mat[0][0]=0;
        mat[0][1]=1;
        mat[1][0]=-1;
        mat[1][1]=0;
    }

    for(int i=1;i<m;i++){
        int x = line2[i].first;
        int y = line2[i].second;
        line2[i].first = x*mat[0][0] + y*mat[0][1];
        line2[i].second = x*mat[1][0] + y*mat[1][1];
    }
    for(int i=0;i<m;i++){
        if(line1[i].first!=line2[i].first or line1[i].second!=line2[i].second) return false;
    }
    return true;
}


void solve(int n){
    vector<int> ans;
    vector<pii> Line1;
    int m;cin>>m;
    int x1,y1;cin>>x1>>y1;
    Line1.PB(MP(0,0));
    rep(i,m-1){
        int x,y;cin>>x>>y;
        Line1.PB(MP(x-x1,y-y1));
    }


    int vx = Line1[1].first - Line1[0].first;
    int vy = Line1[1].second - Line1[0].second;

    if(vx==0 && vy>0){
        mat[0][0]=1;
        mat[0][1]=0;
        mat[1][0]=0;
        mat[1][1]=1;
    }else if(vx==0 && vy<0){
        mat[0][0]=-1;
        mat[0][1]=0;
        mat[1][0]=0;
        mat[1][1]=-1;
    }else if(vx>0 && vy==0){
        mat[0][0]=0;
        mat[0][1]=-1;
        mat[1][0]=1;
        mat[1][1]=0;
    }else if(vx<0 && vy==0){
        mat[0][0]=0;
        mat[0][1]=1;
        mat[1][0]=-1;
        mat[1][1]=0;
    }

    for(int i=1;i<m;i++){
        int x = Line1[i].first;
        int y = Line1[i].second;
        Line1[i].first = x*mat[0][0] + y*mat[0][1];
        Line1[i].second = x*mat[1][0] + y*mat[1][1];
    }


    rep(idx,n){
        //cout << "index : " << idx + 1 << endl;
        // ?????????i
        int m;cin>>m;
        vector<pii> Line(m);
        rep(i,m) cin>>Line[i].first>>Line[i].second;
        for(int i=1;i<m;i++){
            Line[i].first -= Line[0].first;
            Line[i].second -= Line[0].second;
        }
        Line[0].first = Line[0].second = 0;

        vector<pii> rev(Line);
        reverse(ALL(rev));
        for(int i=1;i<m;i++){
            rev[i].first -= rev[0].first;
            rev[i].second -= rev[0].second;
        }
        rev[0].first = 0;
        rev[0].second = 0;
        if(same(Line1,Line)){
            ans.PB(idx);
        }
        else if(same(Line1,rev)){
            ans.PB(idx);
        }
    }
    for(int i=0;i<ans.size();i++){
        cout << ans[i]+1 << endl;
    }
    cout << "+++++" << endl;
}

int main(){
    int n;
    while(cin>>n){
        if(n==0) break;
        solve(n);
    }
}

Measured memory_bytes: 3076