def loadX3C(name):
    """Load an X3C instance in the format:
       n elements
       s set1
       s set2
       ...
       s last set

       Return a pair (elements, list of sets) where each set is a list and the set at index 0 is a dummy empty set"""

    n = 0
    sets = []

    f = open(name, "r")
    lines = f.readlines()
    for l in lines:
        s = l.split()
        if len(s) < 1:
            continue
        if s[0] == "c":
            continue
        elif s[0] == "n":
            n = int(s[1])
        elif s[0] == "s":
            (x, y, z) = (int(s[1]), int(s[2]), int(s[3]))
            sets += [[x, y, z]]

    f.close()
    return (n, sets)