def x2fs(X, fields, type=''):
    if (type == 'Interaction'):
        s2 = (lambda x: (x + 1))
        e2 = (lambda x, y: y)
    elif (type == 'Quadratic'):
        s2 = (lambda x: x)
        e2 = (lambda x, y: y)
    elif (type == 'Purely Quadratic'):
        s2 = (lambda x: x)
        e2 = (lambda x, y: (x + 1))
    else:
        return
    l1 = len(X[0])
    l2 = len(X[0])
    for i in range(len(X)):
        r = X[i]
        for j1 in range(l1):
            for j2 in range(s2(j1), e2(j1, l2)):
                r.append((r[j1] * r[j2]))
    for j1 in range(l1):
        for j2 in range(s2(j1), e2(j1, l2)):
            fields.append(((fields[j1] + '*') + fields[j2]))
def x2fs(X, fields, type=):
    if (type == 'Interaction'):
        s2 = (lambda x: (x + 1))
        e2 = (lambda x, y: y)
    elif (type == 'Quadratic'):
        s2 = (lambda x: x)
        e2 = (lambda x, y: y)
    elif (type == 'Purely Quadratic'):
        s2 = (lambda x: x)
        e2 = (lambda x, y: (x + 1))
    else:
        return
    l1 = len(X[0])
    l2 = len(X[0])
    for i in range(len(X)):
        r = X[i]
        for j1 in range(l1):
            for j2 in range(s2(j1), e2(j1, l2)):
                r.append((r[j1] * r[j2]))
    for j1 in range(l1):
        for j2 in range(s2(j1), e2(j1, l2)):
            fields.append(((fields[j1] + '*') + fields[j2]))