def calc_L(N: int, N1: int, N2: int) -> list:
    """
    Calculation of 4 distances:
    1. The minimum distance from the initial vertex to the end.
    2. The minimum distance from the initial vertex to the final (when moving
        in the other direction).
    3. A distance after a full turn around the graph in the direction of
    the smallest distance from initial vertex to the end;
    4. A distance after a full turn around the graph in the direction of
    the greatest distance from initial vertex to the end.
    """
    L = [
        min(abs(N2 - N1), N - abs(N2 - N1)),
        max(abs(N2 - N1), N - abs(N2 - N1)),
        N + min(abs(N2 - N1), N - abs(N2 - N1)),
        N + max(abs(N2 - N1), N - abs(N2 - N1)),
    ]
    return L