#!/usr/bin/python
# -*- coding: utf-8 -*-

def getList(num, target):
    r = []
    for i in range(len(target)):
        r.append(target[i:(num+i)])
    return r


if __name__ == '__main__':
    num = 2
    str = 'paraparaparadise'
    str2 = 'paragraph'

    x = getList(num, str)
    y = getList(num, str2)

    s = set(x)
    # 和集合
    print list(s.union(y))
    # 積集合
    print list(s.intersection(y))
    # 差集合
    print list(s.difference(y))
