Problem: You have a set of dominoes. Each domino is a rectangular tile with a line dividing its face into two square ends. Can you put all dominoes in a line one by one from left to right so that any two dominoes touched with the sides that had the same number of points? You can rotate the dominoes, changing the left and the right side (domino "1-4" turns into "4-1").

Input

The first line contains number n (1 ≤ n ≤ 100). Next n lines contains the dominoes. Each of these lines contains two numbers — the number of points (spots) on the left and the right half, correspondingly. The numbers of points (spots) are non-negative integers from 0 to 6.

Output

Print "No solution", if it is impossible to arrange the dominoes in the required manner. If the solution exists, then describe any way to arrange the dominoes. You put the dominoes from left to right. In each of n lines print the index of the domino to put in the corresponding position and then, after a space, character "+" (if you don't need to turn the domino) or "–" (if you need to turn it).

Examples

Input

5
1 2
2 4
2 4
6 4
2 1


Output

2 -
1 -
5 -
3 +
4 -

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const long double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
int matrix[111][111];
pair<int, int> p[111];
int degrees[111];
vector<int> answer;
char visited[111];
int n, a, b, startVertex;
void dfs(int vertex) {
  for (int i = 0; i < 7; i++) {
    if (matrix[vertex][i]) {
      matrix[vertex][i]--;
      matrix[i][vertex]--;
      degrees[vertex]--;
      degrees[i]--;
      dfs(i);
    }
  }
  answer.push_back(vertex);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &p[i].first, &p[i].second);
    matrix[p[i].first][p[i].second]++;
    matrix[p[i].second][p[i].first]++;
    degrees[p[i].first]++;
    degrees[p[i].second]++;
  }
  int odd = 0;
  for (int i = 0; i < 7; i++) {
    if (degrees[i] % 2) {
      odd++;
    }
  }
  if (odd > 2) {
    printf("No solution");
    return 0;
  }
  for (int i = 0; i < 7; i++) {
    if (odd) {
      if (degrees[i] % 2) {
        dfs(i);
        break;
      }
    } else {
      if (degrees[i]) {
        dfs(i);
        break;
      }
    }
  }
  if ((int)answer.size() != n + 1) {
    printf("No solution");
    return 0;
  }
  for (int i = 0; i < (int)answer.size(); i++) {
    fprintf(stderr, "%d ", answer[i]);
  }
  for (int i = 0; i < (int)answer.size() - 1; i++) {
    int a = answer[i];
    int b = answer[i + 1];
    for (int j = 0; j < n; j++) {
      if (!visited[j]) {
        if (a == p[j].first && b == p[j].second) {
          printf("%d +\n", j + 1);
          visited[j] = true;
          break;
        }
        if (b == p[j].first && a == p[j].second) {
          printf("%d -\n", j + 1);
          visited[j] = true;
          break;
        }
      }
    }
  }
  return 0;
}