fork download
  1. program ideone;
  2. var i,j,e,n,c,sumj,sume:smallint;
  3. begin
  4. read(j,e,n);
  5. sumj:=0;
  6. sume:=0;
  7. for i:=1 to n do
  8. begin
  9. read(c);
  10. if(c=j) then sumj:=sumj+1;
  11. if(c=e) then sume:=sume+1;
  12. end;
  13. if(sumj>sume) then writeln('Jergus');
  14. if(sume>sumj) then writeln('Ema');
  15. if(sumj=sume) then writeln('remiza');
  16. end.
Success #stdin #stdout 0s 340KB
stdin
1 0
4
8 1 0 1
stdout
Jergus