// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import java.util.Random;

public class Normal
{
    public static final int N = 100000;
    public static void test(double e, double s) {
        Random rng = new Random();
        int[] one1 = new int[4];
        int[] one2 = new int[4];
        for(int i = 0; i < N; i++) {
            double u1 = rng.nextDouble();
            double u2 = rng.nextDouble();
            double h1 = Math.sqrt(-2 * Math.log(u1));
            double h2 = 2 * Math.PI * u2;
            double n1 = e + s * h1 * Math.sin(h2);
            double n2 = e + s * h1 * Math.cos(h2);
            if(n1 < e - 1.96 * s) {
                one1[0]++;
            } else if(n1 < e) {
                one1[1]++;
            } else if(n1 < e + 1.96 * s) {
                one1[2]++;
            } else {
                one1[3]++;
            }
            if(n2 < e - 1.96 * s) {
                one2[0]++;
            } else if(n2 < e) {
                one2[1]++;
            } else if(n2 < e + 1.96 * s) {
                one2[2]++;
            } else {
                one2[3]++;
            }
        }
        for(int i = 0; i < 4; i++)
        {
            System.out.println(one1[i] + " " + one2[i]);
        }
    }
    public static void main(String[] args) {
        test(0, 1);
        test(7, 3);
    }
}
