#include using namespace std; int main() { string S; cin >> S; tuple A, B; get<0>(A) = S.at(0); get<1>(A) = 1; get<2>(A) = 1; get<3>(A) = true; for (int i = 1; i < (int)S.size(); i++) { if (S.at(i) != get<0>(A) && get<3>(B) == false) { get<0>(B) = S.at(i); get<1>(B) = i + 1; get<2>(B) = 1; get<3>(B) = true; } else if (S.at(i) != get<0>(A) && get<3>(B) == true) get<2>(B)++; else get<2>(A)++; } if (get<2>(A) > get<2>(B)) cout << get<1>(B) << ' ' << get<0>(B) << endl; else cout << get<1>(A) << ' ' << get<0>(A) << endl; }