#include #include void pre(void){ FILE *fp=fopen("313data","r"); if(fp==NULL){ printf("error\n"); return; } int cnt[256]={0}; char t=getc(fp); while(t!=EOF){ cnt[(int)t]++; t=getc(fp); } int i; for(i=0;i<10;i++){ printf("%d,",cnt['0'+i]); } printf("\n"); return; } void run(void){ int cnt[]={20104,20063,19892,20011,19874,20199,19898,20163,19956,19841}; char t; t=getc(stdin); while(t!=EOF){ if(t>='0' && t<='9'){ cnt[(int)(t-'0')]--; } t=getc(stdin); } int a,b; int i; for(i=0;i<10;i++){ if(cnt[i]>0) b=i; if(cnt[i]<0) a=i; } printf("%d %d\n",a,b); return; } int main(void){ //pre(); run(); return 0; }