# Relatran
import math
relation = math.exp(1)
gears = 2
teeth_min = 8
teeth_max = 32
rels = {}
for t1 in range(teeth_min, teeth_max+1):
for t2 in range(teeth_min, teeth_max+1):
rel = float(t1)/t2
if not rel in rels:
rels[rel] = [t1, t2, rel]
best_r = 1
rels12 = {}
for r1 in rels:
for r2 in rels:
r12 = r1 * r2 / relation
if not r12 in rels12:
rels12[r12] = [r1, r2]
count = len(rels)
paso = 0
for r3 in rels:
if paso <= 0:
paso = len(rels) / 100
print (100*count)/len(rels),
count -= paso
paso -=1
for rel12 in rels12:
if abs(rel12 * r3 - 1) < best_r:
best_r = abs(rel12 * r3 - 1)
r1, r2 = rels12[rel12]
print '\n\n', best_r, rels[r1], rels[r2], rels[r3], r1*r2*r3