#!/usr/bin/env python
# -*- coding: utf-8 -*-


def hrtime(time):
	"""return human readable duration of time e.g. 3 y 56 d 22 hr 31 min 1.842 sec"""
	
	units =   ['y',     'd', 'hr', 'min', 'sec']
	amounts = [365.2425, 24,  60,   60,    1]
	divider = reduce(lambda a, b: a*b, amounts)
	t1 = time
	out = []
	for i in range(len(units)-1):
		mod, rem = t1//divider, time % divider
		if mod >= 1:
			out.append("%d %s" % (mod, units[i]))
		divider /= amounts[i]
		t1 = rem
	mod = t1/divider
	out.append("%.3f %s" % (mod, units[-1]))
	return ' '.join(out) + ' (%s)' % time