#include <bits/stdc++.h>
using namespace std;
long long poww(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
const long long MAXN = 1e6 + 10;
const long long INF = 8e18;
const long long MOD = 1e9 + 7;
int n, vis[MAXN], vis2[MAXN];
vector<pair<pair<int, int>, int>> adj[MAXN];
vector<pair<int, int>> ans;
void dfs(int v, int ind, int dir) {
  while (!adj[v].empty()) {
    pair<pair<int, int>, int> e = adj[v].back();
    adj[v].pop_back();
    if (vis[e.first.second]) continue;
    vis[e.first.second] = true;
    dfs(e.first.first, e.first.second, e.second);
  }
  ans.push_back({ind, 1 - dir});
}
void dfs2(int v) {
  vis2[v] = true;
  for (auto e : adj[v]) {
    if (!vis2[e.first.first]) dfs2(e.first.first);
  }
}
inline char cv(int x) {
  if (x == 0) return '-';
  return '+';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back({{v, i}, 1});
    adj[v].push_back({{u, i}, 0});
  }
  for (int i = 0; i <= 6; i++) {
    if (!adj[i].empty()) {
      dfs2(i);
      for (int j = 1; j <= 6; j++)
        if (!adj[j].empty() && !vis2[j])
          return cout << "No solution" << '\n', 0;
      break;
    }
  }
  pair<int, int> odd_edge = {10, 10};
  for (int i = 0; i <= 6; i++) {
    if (adj[i].size() & 1) {
      if (odd_edge.first == 10)
        odd_edge.first = i;
      else if (odd_edge.second == 10)
        odd_edge.second = i;
      else
        return cout << "No solution" << '\n', 0;
    }
  }
  adj[odd_edge.first].push_back({{odd_edge.second, n + 10}, 1});
  adj[odd_edge.second].push_back({{odd_edge.first, n + 10}, 0});
  for (int i = 0; i <= 6; i++) {
    if (!adj[i].empty()) {
      dfs(i, n + 5, 0);
      break;
    }
  }
  int bad_ind = -1, bad_ind_val = -1;
  for (int i = 0; i < ans.size(); i++)
    if (ans[i].first > bad_ind_val) bad_ind = i, bad_ind_val = ans[i].first;
  for (int i = bad_ind + 1; i < ans.size(); i++)
    if (ans[i].first <= n)
      cout << ans[i].first << ' ' << cv(ans[i].second) << '\n';
  for (int i = 0; i < bad_ind; i++)
    if (ans[i].first <= n)
      cout << ans[i].first << ' ' << cv(ans[i].second) << '\n';
  return 0;
}
