private boolean find(final List<Pair<Integer, SimpleSequence>> nrs,
                         int left,
                         int first,
                         int previous,
                         Map<SimpleSequence, Integer> solution) {
        if (left > 0) {
            final int min = previous <= 0 ? 0 : previous % 100 * 100;
            final int max = previous <= 0 ? Integer.MAX_VALUE : min + 100;

            for (final Pair<Integer, SimpleSequence> nr : nrs) {
                final int n = nr.getFirst();
                if (n >= max) {
                    return false;
                } else if (n >= min && !solution.containsKey(nr.getSecond())) {
                    solution.put(nr.getSecond(), nr.getFirst());
                    if (find(nrs, left - 1, first == 0 ? nr.getFirst() : first, nr.getFirst(), solution)) {
                        return true;
                    }
                    solution.remove(nr.getSecond());
                }
            }

            return false;
        } else {
            return first / 100 == previous % 100;
        }
    }