# Haskell, <s>67 59</s> 58 bytes <!-- language-all: lang-haskell --> (q:r)!x|x<last q=q:r!x|1<2=(q++[x]):r _!x=[[x]] foldl(!)[] **Explanation:** Given a list of lists (that are already sorted) and a value `x`, the `!` operator will place `x` inside the first list whose last element is less than or equal to `x`. If no such list exists, the list `[x]` is placed at the end. [Try it online.](https://tio.run/##XYu/CsMgHIR3n@KEDkp@Q5P@D/FJRIqQSkNtUk0Gh767NUuHDMfdx8c97fx6eJ@zCG2UPH1T5@28IKjCBeuuUSJUlU5GtpHdeVK6bMOccpPvveBSm/y2wwiFfmLAJw7jgh0cdE1oCCfCkXAgXMxG7wlrbmtt3P90LT/C2eQf)