#include <cstdio>
#include <cstring>

const int MaxL = 7*2 + 1, MaxN = 3, MaxM = 25 + 1;

char ans[MaxN][MaxL];
int x[MaxN][MaxM * MaxM], y[MaxN][MaxM * MaxM];
int b[MaxM][MaxM];
int l[MaxN];
  
int main(void)
{
  int i, j, k, t;
  freopen ("snakes2.in", "rt", stdin);
  freopen ("snakes2.out", "wt", stdout);

  while (scanf ("%d", &k) != EOF)
  {

    memset (b, 0, sizeof(b));
    memset (ans, 0, sizeof(ans));
    t = 1;
    for (j = 0; j < k; j++)
    {
      scanf ("%d", &l[j]);
      for (i = 0; i < l[j]; i++)
      {
        scanf ("%d %d", &x[j][i], &y[j][i]);
        b[x[j][i]][y[j][i]] ++;
      }
    }

    t = 1;
    for (j = 0; j < k; j++)
    {
      int lans = 0;
      for (i = 0; i < l[j]; i++)
        if (b[x[j][i]][y[j][i]] == 2)
          lans++;
      for (i = 0; i < lans/2; i++)
        putchar ('-');
      for (; i < lans; i++)
        putchar ('+');
      putchar('\n');
    }
  }
  return 0;
}