#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

void main (void) {
  long count,cyc;
  long p1,p2;
  p1=0; p2=0; count=0; cyc=0;
  double w,x,y,z,t;
  while (1) {
    w = -log(drand48());
    x = -log(drand48());
    y = -log(drand48());
    z = -log(drand48());
/*
    w = (drand48());
    x = (drand48());
    y = (drand48());
    z = (drand48());
*/
    if (w>x) {t=w;w=x;x=t;}
    if (w>y) {t=w;w=y;y=t;}
    if (w>z) {t=w;w=z;z=t;}
    if (x>z) {t=x;x=z;z=t;}
    if (x>y) {t=x;x=y;y=t;}
    if (y>z) {t=y;y=z;z=t;}
    if (z>x+y) p1++;
    if (y>w+x) p2++;
    count++;
    cyc++;
//    printf("%3d %3d %3d %f %f %f %f\n",count,p1,p2,w,x,y,z); 
    if (cyc==5000) {
      cyc=0;
      cout << p1*1.0/count << " " << p2*1.0/count << "\n";
    }
  }
}

