import collections


def secs_to_text(cs):
    """Convert time in seconds to a human readable string.
    """
    v = collections.OrderedDict()
    v['s'] = cs % 60
    cs //= 60
    v['m'] = cs % 60
    cs //= 60
    v['h'] = cs % 24
    cs //= 24
    v['d'] = cs
    parts = []
    for k in v:
        if v[k] != 0:
            parts.append("{}{}".format(v[k], k))
    return "_".join(parts[::-1])