@Override
    protected void execute(Scanner in, PrintStream out) {
        for (String line = in.nextLine(); !line.equals("0 0"); line = in.nextLine()) {

            StringTokenizer tokenizer = new StringTokenizer(line);
            final int m = Integer.parseInt(tokenizer.nextToken());
            final int n = Integer.parseInt(tokenizer.nextToken());

            SortedSet<CubeSet> results = new TreeSet<>();
            for (int b = 1; b <= n; ++b) {
                for (int c = b; c <= n; ++c) {
                    for (int d = c; d <= n; ++d) {
                        Double a = f(b, c, d);
                        if (a > n) break;
                        if (a >= m && a % 1 == 0) results.add(new CubeSet(a.intValue(), b, c, d));
                    }
                }
            }

            for (CubeSet result : results) {
                out.println(result);
            }
            out.println("+++");
        }
    }