def format_seconds(n: int) -> str:
    """Format seconds into pretty string format."""
    days = int(n // (24 * 3600))
    n = n % (24 * 3600)
    hours = int(n // 3600)
    n %= 3600
    minutes = int(n // 60)
    n %= 60
    seconds = n
    if days > 0:
        strtime = f'{days}d {(hours)}h:{minutes}m:{int(seconds)}s'
    elif hours > 0:
        strtime = f'{(hours)}h:{minutes}m:{int(seconds)}s'
    elif minutes > 0:
        strtime = f'{minutes}m:{int(seconds)}s'
    else:
        strtime = f'{seconds:.2f}s'
    return strtime