import csv


def import_tracks(path):
    """
    Import tracks saved in the competition format. NB only imports 1D and 2D tracks

    Parameters:
    path: path to file

    Returns:
    1D and 2D trajectories in list format

    """

    t = csv.reader(open(path, 'r'), delimiter=';', lineterminator='\n', quoting=csv.QUOTE_NONNUMERIC)
    X = [[], []]
    for trajs in t:
        if int(trajs[0]) in [1, 2]:
            X[int(trajs[0]) - 1].append(trajs[1:])
    return X[0], X[1]