#include <iostream>
#include <map>
#include <string>
#include <complex>
#include <vector>

using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)

typedef complex<double> Point;

bool same2(vector<Point> const & a, vector<Point> b){
    int n = a.size(), m = b.size();
    if(n-m) return false;
    for(int i=n-1;i>=0;i--) b[i] -= b[0];
    for(int i=n-1;i>=0;i--) b[i] /= b[1];
    rep(i,n) if(abs(a[i]-b[i]) > 1e-8) return false;
    return true;
}

bool same(vector<Point> const & a, vector<Point> const & b){
    vector<Point> rb = b;
    rep(i,rb.size()/2) swap(rb[i],rb[rb.size()-i-1]);
    return same2(a,b) || same2(a,rb);
}

int main(){
    int n;
    while(cin >> n && n){
        int l;
        cin >> l;
        vector<Point> X(l);
        rep(i,l){
            int x,y;
            cin >> x >> y;
            X[i] = Point(x,y);
        }
        for(int i=l-1;i>=0;i--) X[i] -= X[0];
        for(int i=l-1;i>=0;i--) X[i] /= X[1];
        rep(i,n){
            int m;
            cin >> m;
            vector<Point> Y(m);
            rep(j,m){
                int x,y;
                cin >> x >> y;
                Y[j] = Point(x,y);
            }
            if(same(X,Y)) cout << i+1 << endl;
        }
        cout << "+++++" << endl;
    }
}