def rightjustify(linetext, linecount, max_countwidth):
    """Justify ordered line to the right

    Arguments:
        linetext {str} -- a text to justify
        linecount {int} -- a line count (1-based)
        max_countwidth {int} -- a maximum count width

    Returns:
        str -- a justified line
    """
    fill_length = max_countwidth - len(str(linecount)) + 1
    return "{}.{}{}".format(linecount, " " * fill_length,  linetext)