time a `deque` and a `intset`
(*hey, I did not know there is a new [`packedset`](https://nim-lang.github.io/Nim/packedsets.html) that will generalize and replace
`intset`*).

The second part was rather straightforward with two nested for loops.

I would say anyway the main technique here is a wise use of `break` statement,
especially using named blocks.

But first things first, parsing the input this time is a simple one-liner:
&quot;&quot;&quot;</span>

nbCode:
  <span class="hljs-keyword">proc</span> pars