import java.time.Duration;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;

public class RareNumbers {
    public interface Consumer5<A, B, C, D, E> {
        void apply(A a, B b, C c, D d, E e);
    }

    public interface Consumer7<A, B, C, D, E, F, G> {
        void apply(A a, B b, C c, D d, E e, F f, G g);
    }

    public interface Recursable5<A, B, C, D, E> {
        void apply(A a, B b, C c, D d, E e, Recursable5<A, B, C, D, E> r);
    }

    public interface Recursable7<A, B, C, D, E, F, G> {
        void apply(A a, B b, C c, D d, E e, F f, G g, Recursable7<A, B, C, D, E, F, G> r);
    }

    public static <A, B, C, D, E> Consumer5<A, B, C, D, E> recurse(Recursable5<A, B, C, D, E> r) {
        return (a, b, c, d, e) -> r.apply(a, b, c, d, e, r);
    }

    public static <A, B, C, D, E, F, G> Consumer7<A, B, C, D, E, F, G> recurse(Recursable7<A, B, C, D, E, F, G> r) {
        return (a, b, c, d, e, f, g) -> r.apply(a, b, c, d, e, f, g, r);
    }

    private static class Term {
        long coeff;
        byte ix1, ix2;

        public Term(long coeff, byte ix1, byte ix2) {
            this.coeff = coeff;
            this.ix1 = ix1;
            this.ix2 = ix2;
        }
    }

    private static final int MAX_DIGITS = 16;

    private static long toLong(List<Byte> digits, boolean reverse) {
        long sum = 0;
        if (reverse) {
            for (int i = digits.size() - 1; i >= 0; --i) {
                sum = sum * 10 + digits.get(i);
            }
        } else {
            for (Byte digit : digits) {
                sum = sum * 10 + digit;
            }
        }
        return sum;
    }

    private static boolean isNotSquare(long n) {
        long root = (long) Math.sqrt(n);
        return root * root != n;
    }

    private static List<Byte> seq(byte from, byte to, byte step) {
        List<Byte> res = new ArrayList<>();
        for (byte i = from; i <= to; i += step) {
            res.add(i);
        }
        return res;
    }

    private static String commatize(long n) {
        String s = String.valueOf(n);
        int le = s.length();
        int i = le - 3;
        while (i >= 1) {
            s = s.substring(0, i) + "," + s.substring(i);
            i -= 3;
        }
        return s;
    }

    public static void main(String[] args) {
        final LocalDateTime startTime = LocalDateTime.now();
        long pow = 1L;
        System.out.println("Aggregate timings to process all numbers up to:");