#include <bits/stdc++.h>
using namespace std;
int main(){
    int hie[100],jie[100],jh=0,jg=0,hg=0,hh=0;
    while(1){
        cin>>hie[jg];
        jh+=hie[jg];
        if(hie[jg]==0) break;
        jg++;
    }
    while(1){
        cin>>jie[hg];
        hh+=jie[hg];
        if(jie[hg]==0) break;
        hg++;
    }
    printf("%.1f ",jh*1.0/jg);
    printf("%.1f",hh*1.0/hg);  
}
/**************************************************************
	Problem: 1319
	User: wangyiyang
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/