Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import heapq
  2.  
  3. pares = [2, 4, 6, 10, 18]
  4. impares = [1, 3, 7, 9, 13, 17]
  5.  
  6. for elmt in heapq.merge(pares, impares):
  7.     print(elmt, end=' ')