#!/usr/bin/python

"""
my2cents 0.1 by kasmra 2007
--------------------------
This program converts just ratios
to cents. 'N' is the nominator and 
'P' is the denominator of given just
ratio.
"""

from __future__ import division
import math

print '--- my2cents 0.1 ---'
print '  (Type 0 to quit)'

cont = True

while cont:

	n = int(input('N: '))
	if n == 0:
		cont = False
		break

	p = int(input('P: '))
	if p == 0:
		cont = False
		break

	answer = math.log10(n/p) * 1200/math.log10(2)

	print str(n)+'/'+str(p)+' is '+str(answer)+' cents.'

