def matchTempLog(templates, logs):
    len_temp = {}
    for (tidx, temp) in enumerate(templates):
        tempL = temp.split()
        templen = len(tempL)
        if (templen not in len_temp):
            len_temp[templen] = [(tidx, tempL)]
        else:
            len_temp[templen].append((tidx, tempL))
    logid_groupid = []
    for (idx, log) in enumerate(logs):
        logL = log.split()
        logid = (idx + 1)
        if (len(logL) in len_temp):
            logid_groupid.append([(idx + 1), get_groupid(logL, len_temp[len(logL)])])
        else:
            logid_groupid.append([(idx + 1), (- 1)])
    return logid_groupid
def matchTempLog(templates, logs):
    len_temp = {}
    for (tidx, temp) in enumerate(templates):
        tempL = temp.split()
        templen = len(tempL)
        if (templen not in len_temp):
            len_temp[templen] = [(tidx, tempL)]
        else:
            len_temp[templen].append((tidx, tempL))
    logid_groupid = []
    for (idx, log) in enumerate(logs):
        logL = log.split()
        logid = (idx + 1)
        if (len(logL) in len_temp):
            logid_groupid.append([(idx + 1), get_groupid(logL, len_temp[len(logL)])])
        else:
            logid_groupid.append([(idx + 1), (- 1)])
    return logid_groupid