#include<iostream>
#include<fstream>
using namespace std;
int main(){
int n,m,a[100],b[100],s[2],i,P=1,S=0;
ifstream f("date.in");
f>>n;
f>>m;
for(i=1;i<=n;i++){
f>>a[i];
if(a[i]>10)S=S+a[i];
}
for(i=1;i<=m;i++){
f>>b[i];
if(b[i]>100)P=P*b[i];
}
s[1]=S;
s[2]=P;
for(i=1;i<=2;i++){
cout<<s[i]<<" ";
}
f.close();
return 0;
}