def status(level, solved, err):
    """Calculate status from status and err."""
    if solved:
        if err:
            status = 'multiple solution'
        else:
            status = 'level ' + str(level)
    else:
        if err:
            status = 'no solution'
        else:
            status = 'give up'
    return status