CartesianSequence

https://codility.com/demo/results/demoYWSHMS-V8E/