#include <fstream>
#include <map>
#include <string>
#define MAXk 3
#define MAXm 25
#define MAXlen MAXm * MAXm

using namespace std;


int main()
{
  ifstream iin("snakes2.in");
  ofstream oout("snakes2.out");
  int i, j, k;
  int len[MAXk];
  int snake[MAXk][MAXlen][2];
  map<pair<int, int>, int> points;
  string intersections[MAXk];
  iin >> k;
  for(i = 0; i < k; i++)
  {
    iin >> len[i];
    for(j = 0; j < len[i]; j++)
    {  
      iin >> snake[i][j][0] >> snake[i][j][1];
      if(points.find(make_pair(snake[i][j][0], snake[i][j][1])) == points.end())
        points[make_pair(snake[i][j][0], snake[i][j][1])] = 1;
      else
        points[make_pair(snake[i][j][0], snake[i][j][1])]++;
    }
  }
  for(i = 0; i < k; i++)
  {
    intersections[i] = "";
    for(j = 0; j < len[i]; j++)
    {  
      if(points[make_pair(snake[i][j][0], snake[i][j][1])] == 2)
      {
        intersections[i] += '+';
	points[make_pair(snake[i][j][0], snake[i][j][1])] = 3;
      }
      else if(points[make_pair(snake[i][j][0], snake[i][j][1])] == 3)
        intersections[i] += '-';
    }
  }
  for(i = 0; i < k; i++)
    oout << intersections[i] << "\n";
  return 0;
}







