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 GCC target("avx,avx2,fma")
#pragma GCC optimization("O8")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long int N = 1e5 + 20, mod = 1e9 + 7, inf = 2e9, maxq = 1e5 + 30;
const long double eps = 0.0000001;
long long int poww(long long int a, long long int b) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % mod, b / 2) % mod
                      : poww(a * a % mod, b / 2) % mod));
}
int n, m;
vector<pair<int, pair<int, bool> > > adj[N];
bool visited[6 * N];
vector<pair<int, bool> > ve;
vector<pair<long long int, long long int> > me;
void dfs(int v, int ind, bool b) {
  while (!adj[v].empty()) {
    auto u = adj[v].back();
    adj[v].pop_back();
    if (!visited[u.second.first]) {
      visited[u.second.first] = 1;
      dfs(u.first, u.second.first, u.second.second);
    }
  }
  if (ind != -1) ve.push_back({ind, b});
  return;
}
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  me.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> me[i].first >> me[i].second;
    adj[me[i].first].push_back({me[i].second, {i + 1, 0}});
    adj[me[i].second].push_back({me[i].first, {i + 1, 1}});
  }
  int cnt = 0, sc = -1;
  for (int i = 0; i < 7; i++) {
    if (adj[i].size() % 2) {
      cnt++;
      sc = i;
    }
    if (!cnt && !adj[i].empty()) {
      sc = i;
    }
  }
  if (cnt != 2 && cnt) {
    cout << "No solution" << '\n';
    return 0;
  }
  dfs(sc, -1, 0);
  for (int i = 1; i < n + 1; i++) {
    if (!visited[i]) {
      cout << "No solution";
      return 0;
    }
  }
  for (auto u : ve) {
    cout << u.first << ' ';
    if (!u.second)
      cout << '-' << '\n';
    else
      cout << '+' << '\n';
  }
  return 0;
}