#include using namespace std; string p, s; void to_lower(string &s) { for (auto &c : s) c = tolower(c); } int main() { getline(cin, p); getline(cin, s); to_lower(p), to_lower(s); int cnt = 0, k = -1; for (int i = 0; i < s.size(); i++) { if (s[i] == ' ') continue; int j = i + 1; while (j < s.size() && s[j] != ' ') j++; if (p == s.substr(i, j - i)) { cnt++; if (k == -1) k = i; } i = j; } if (!cnt) puts("-1"); else cout << cnt << ' ' << k << endl; return 0; }