def shallowfy(lista):
      shallow = []
      for el in lista:
        if (isinstance(el, list)):
          shallow_el = shallowfy(el)
          for subel in shallow_el:
            shallow.append(subel)
        else:
          shallow.append(el)
      return shallow
      
print(shallowfy([1, 2, [[[3, [4], 5, [6, 7, [[8, 9], 10, [11]], 12], 13], 14], 15], 16, [17, [[[18]]], 19], 20]))
print(shallowfy([[1, 2], [3, 4, 5], [], [6, 7]]))
