#!/usr/bin/env gosh (read-line) (let ((gears (read (open-input-string (string-append "(" (read-line) ")"))))) (define r (/ (car (reverse gears)) (car gears))) (if (integer? r) (display (format "~D/~D" r 1)) (display r)) (newline))