import java.lang.*;
import java.util.*;
import java.io.*;

public class MathSqrt {
	public static long sqrt( long x ) {
		long res = (long)Math.sqrt(x >>> 2) * 2;
		return (x > (res + 1) * (res + 1)) ? (res + 1) : res;
	}
	
    public static void main(String args[]) {
    	long x = (long)((1L << 62) * 1.1);
    	for (int i = 0; i < 2; i++) {
    		long root = sqrt(x);
	        System.out.format("%20d -> %d : diff = %d, diff1 = %d\n", x, root, x - root * root, x - (root + 1) * (root + 1));
	        x *= 3;
    	}
    }
}