Problem: Sumit had borrowed money from many of his batch mates and today he has decided to pay them  because he has got lottery today.

The amount of lottery is very large. So to count the money he decided to write the amount in Indian system first.

In the Indian system the rightmost comma is placed after three rightmost digits, and then a comma is placed after every two digits from the right.

He has asked you to write code for that.

Input

First line contains T number of test cases.

Each test case contain the amount . The amount is in string whose maximum length is 10^4.

Output

Print T lines of output each containing the amount in Indian way of writing with commas.

If amount is less than or equal to 3 digits, then do not put any commas.

Constraints

1 ≤ T ≤200

1 ≤ |amount| ≤10^4

SAMPLE INPUT
3
12345
54321
125634

SAMPLE OUTPUT
12,345
54,321
1,25,634

Solution (in PYTHON):

Solution:
import sys

t=int(raw_input())
while t>0:
	t-=1
	a=raw_input()
	l=len(a)
	if l<=3:
		print a
	else:
		ll=l-3
		i=0
		if ll%2==0:			
			while i < l-3:
				sys.stdout.write(a[i])
				i+=1
				sys.stdout.write(a[i])
				i+=1
				sys.stdout.write(',')
		else:
			sys.stdout.write(a[0])
			sys.stdout.write(',')
			i=1
			while i < l-3:
				sys.stdout.write(a[i])
				i+=1
				sys.stdout.write(a[i])
				i+=1
				sys.stdout.write(',')
		for i in range(l-3,l):
			sys.stdout.write(a[i])
		print ' '