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 PYTHON):

Solution:
import sys
sys.setrecursionlimit(10**5)

def find_tour(G):
    """
    Where G is an undirected graph
    """
    
    tour=[]
    visited_edges=defaultdict(int)

    for u in G:
        for v in G[u]:
            visited_edges[u,v]+=1
    

    def recurse(u):
        
        for v in G[u]:
            if not visited_edges[u,v]:continue
            visited_edges[u,v]-=1           
            visited_edges[v,u]-=1
            recurse(v)
        
        
        tour.append(u)
        

    

    current=G.keys()[0]
    count=0
    for u in G:
        if len(G[u])%2:
            current=u
            count+=1

    if count>2:return None
    
    recurse(current)
    tour.reverse()
    return tour

from collections import defaultdict


def main():
    G=defaultdict(list)
    n=input()
    E=defaultdict(list)
    En=0
    for i in range(n):
        a,b=map(int,raw_input().strip().split())
        G[a].append(b)
        G[b].append(a)
        E[(a,b)].append(i+1)
        En+=1

    r=find_tour(G)
    if not r or En!=len(r)-1:
        print "No solution"
        return
    
    for i in range(len(r)-1):
        if (r[i],r[i+1]) in E and E[r[i],r[i+1]] :print str(E[r[i],r[i+1]].pop())+" +"
        else:print str(E[r[i+1],r[i]].pop())+" -"

main()