#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>

using namespace std;

const int N = 1111;
int dp[N][N], pos[N], n;
char origin[N], s[N];

int main () {
    int cas = 1, K;
    while(scanf("%d", &K)!=EOF) {
        getchar(); gets(origin);
        n = 0;
        for(int i=0;origin[i];++i) if(isalpha(origin[i])) {
            s[n] = origin[i]; pos[n] = i;
            if(s[n]<='Z'&&s[n]>='A') s[n] += 'a' - 'A';
            n ++;
        }
        s[n] = 0;
        for(int i=0;i<n;++i) dp[i][i] = 0;
        for(int i=0;i<n;++i) dp[i][i+1] = s[i]!=s[i+1];
        for(int l=2;l<n;++l) for(int i=0;i+l<n;++i) {
            dp[i][i+l] = dp[i+1][i+l-1] + (s[i] != s[i+l]);
        }
        int _max = 0;
        for(int i=0;i<n;++i) for(int j=i;j<n;++j) if(dp[i][j]<=K) {
            _max = max(_max, pos[j]-pos[i]+1);
        }
        bool ok = 1;
        for(int i=0;i<n&&ok;++i) for(int j=i;j<n&&ok;++j) if(dp[i][j]<=K&&pos[j]-pos[i]+1==_max) {
            ok = 0;
            printf("Case %d: %d %d\n", cas++, _max, pos[i]+1);
        }
    }
    return 0;
}