def humanize(t):
    """
    >>> print humanize(0)
    now
    >>> print humanize(1)
    in a minute
    >>> print humanize(60)
    in a minute
    >>> print humanize(61)
    in 2 minutes
    >>> print humanize(3600)
    in an hour
    >>> print humanize(3601)
    in 2 hours
    """
    m, s = divmod(t, 60)
    if s:
        m += 1                 # ceil minutes 
    h, m = divmod(m, 60)
    if m and h:
        h += 1                 # ceil hours
#    d, h = divmod(h, 24)

    if h > 1:
        res = 'in %d hours' % h
    elif h == 1:
        res = 'in an hour'
    else:
        if m > 1:
            res = 'in %d minutes' % m
        elif m == 1:
            res = 'in a minute'
        else:
            res = 'now'
    return res