j;unsigned char c,x[11]="dcdcbcbcda"; main(i){ while(~scanf("%c", &c))if(c>47)x[c-48]--; for(;x[i++]%4!=3;);for(;x[j++]%4!=1;); printf("%d %d\n", i-1, j-1); return 0; }