//1053
#include <iostream>
using namespace std;
int main(){
int n,d,cnt=0;
double e,used;
cin>>n>>e>>d;
int may=0,must=0;
for(int i=0;i<n;i++){
int k;cin>>k;
for(int j=0;j<k;j++){
cin>>used;
if(used<e)
cnt++;
}
if(cnt>(k/2)){
k>d?must++:may++;
}
cnt=0;
}
double r1=(double)may/n*100;
double r2=(double)must/n*100;
printf("%.1f%% %.1f%%",r1,r2);
return 0;
}