#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const int INFF = 100010;
int n, c[MAXN];
string s, b[11];
int endWith(int i, int bi) {
  const string &bs = b[bi];
  const int bl = bs.length();
  if (bl > i) return INFF;
  for (int j = bl - 1; j >= 0; --j) {
    if (bs[j] != s[i - bl + j]) {
      return INFF;
    }
  }
  return bl;
}
int main() {
  while (cin >> s >> n) {
    for (int i = 0; i < n; ++i) cin >> b[i];
    for (int i = 1; i <= s.length(); ++i) {
      int mini = INFF;
      for (int bi = 0; bi < n; ++bi) mini = min(mini, endWith(i, bi));
      c[i - 1] = mini;
    }
    int maxi = 0, temp = 0, ii = 0;
    for (int i = 0; i < s.length(); ++i) {
      ++temp;
      if (temp >= c[i]) temp = c[i] - 1;
      if (temp > maxi) {
        maxi = temp;
        ii = i - temp + 1;
      }
    }
    printf("%d %d\n", maxi, ii);
  }
  return 0;
}
