/*********************????******************
??
???????????????????????????????
???????????????????????????????
????????????0???????????????????
???????????????????????????????
????????????????????????????????
????????????????????????????????
???????????????????????????.
????????????????????????????????
???????????????????????????????
?????????????????????????????
????
???????????????????????????????
???????????????????????????????
????????100
????
???????????????????????????????
?????????????????????
????
((()(())())(()))
????
2 3
5 6
4 7
8 9
1 10
12 13
11 14
0 15
**********************************************************
programmer Qiu Hezi
version 2.0(??)
creat date 2012.11.20 22:19
**********************************************************/
/*??????n???????n????????????
????????????1???4????2?3???????????*/
char boy;
int first=0;
int fun (int n)
{
    char temp;
    temp = cin.get();//cin.get(temp);//????n???
    if (first==0)
    {
        boy=temp;
        first=1;
    }
    if (temp== boy )
    {
        int num=fun(n+1);
        cout<<n<<" "<<num<<endl;//????????????
        return fun(num+1);//???????
    }
    else
        return (n);
}
int main()
{
    fun(0);
    return 0;
}
