from collections import deque
import itertools from itertools import permutations from itertools import combinations