Problem: Chris always struggle in converting angles from degree to radian or vice-verse. You being his best friend whom he trusts so much, decided to help him out. Sam has T angles you need to convert them in radian and represent them in fraction(i.e P/Q) and simplest form.
[Note]: be careful with sign convention here π=$.

Input

The first line contains a single integer(T), the number of test cases.
Then next T lines follow, each having integral value of angle(denoted by A).  

Output

You need to print the equivalent value of degree in radian.
Sam wants the answer in fractional form and the symbol pi to be denoted by '$' sign(without the quotes).

Constraints
1 ≤ T ≤ 1000
1 ≤ A ≤ 10^9

SAMPLE INPUT
5
90
180
87
720
4

SAMPLE OUTPUT
$/2
$
29$/60
0$
$/45

Solution (in PYTHON):

Solution:
a = int(raw_input())
def gcd(b,a):
 if a < b:
  x=gcd(a,b)
  return x
 if b== 0: return a
 else:
  y= gcd(b , a%b)
  return y
 
while a>0:
 a-=1
 b = int(raw_input())
 b = b%360
 d =gcd(b,180)
 n = str(b/d)
 n2 =str(180/d)
 if n == '1':
  if n2 == '1': l = '$'
  else: l = '$'+'/'+n2
 else:
  if n2== '1': l = n+'$'
  else: l = n+'$/'+n2
 print l