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

using namespace std;

const int INF = 1000000000;
const int MAXN = 200001;

int c[MAXN * 3 + 10];
int n;
char s[MAXN + 10];
int sum[MAXN + 10];

int lowbit(int x) {
    return x & (-x);
}

void update(int pos, int delta) {
    while (pos <= n) {
        c[pos] = min(c[pos], delta);
        pos += lowbit(pos);
    }
}

int query(int end) {
    int res = INF;
    while (end > 0) {
        res = min(res, c[end]);
        end -= lowbit(end);
    }
    return res;
}

bool isvowel(char x) {
    if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') return true;
    if (x == 'A' || x == 'E' || x == 'I' || x == 'O' || x == 'U') return true;
    return false;
}

int main() {
    scanf("%s", s);
    int len = strlen(s);
    n = 3 * len + 1;
    for (int i = 0; i <= n; i++) {
        c[i] = INF;
    }
    memset(sum, 0, sizeof(sum));
    for (int i = 0; i < len; i++) {
        sum[i + 1] = sum[i] + (isvowel(s[i]) ? -1 : 2);
    }

    int ret = -1;
    update(sum[0] + len + 1, 0);
    for (int i = 1; i <= len; i++) {
        int p = query(sum[i] + len + 1);
        if (p != INF && i - p > ret) {
           ret = i - p;
        }
        update(sum[i] + len + 1, i);
    }

    if (ret == -1) {
       printf("No solution\n");
    } else {
        int count = 0;
        for (int i = 0; i <= len; i++) {
            if (i + ret > len) break;
            if (sum[i + ret] - sum[i] >= 0) {
               count++;
            }
        }
        printf("%d %d\n", ret, count);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;

const int N = 200100;
const int INF = 0x3f3f3f3f;

int n;
char S[ N ];
int OFFSET;

struct fenwick {
    int tree[ 400100 ];
    int n;
    fenwick( ) {
        memset( tree, INF, sizeof( tree ) );
        n = 400009;
    }
    inline void add( int x, int val ) { for( ; x < n; x += x & -x ) tree[ x ] = min( tree[ x ], val ); }
    inline int get( int x ) { int ans = INF; for( ; x; x -= x & -x ) ans = min( ans, tree[ x ] ); return ans; }
}F;

inline int change( char a ) {
    if( a == 'A' || a == 'a' || a == 'E' || a == 'e' || a == 'I' || a == 'i' || a == 'O' || a == 'o' ) return -1;
    if( a == 'U' || a == 'u' ) return -1;
    return +2;
}

inline void load( ) {
    scanf( "%s", S + 1 );
    n = strlen( S + 1 );
    OFFSET = 200001;
}

inline void solve( ) {
    int sum = 0;
    int ans = 0, cnt = 0;
    F.add( OFFSET, 0 );
    for( int i = 1; i <= n; i++ ) {
        sum += change( S[ i ] );
       // printf( "sum == %d\n", sum );
        int wh = F.get( sum + OFFSET );
       // printf( "wh == %d\n", wh );
       // system( "pause" );
        if( wh != INF ) {
            if( i - wh > ans ) {
                ans = i - wh;
                cnt = 1;
            }
            else if( i - wh == ans ) cnt++;
        }

        F.add( sum + OFFSET, i );
    }
    if( !ans && !cnt ) printf( "No solution\n" );
    else
    printf( "%d %d\n", ans, cnt );
}

int main( void ) {
    load( );
    solve( );
  //  system( "pause" );
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;

const int N = 200100;
const int INF = 0x3f3f3f3f;

int n;
char S[ N ];
int OFFSET;

struct fenwick {
    int tree[ 600100 ];
    int n;
    fenwick( ) {
        memset( tree, INF, sizeof( tree ) );
        n = 600009;
    }
    inline void add( int x, int val ) { for( ; x < n; x += x & -x ) tree[ x ] = min( tree[ x ], val ); }
    inline int get( int x ) { int ans = INF; for( ; x; x -= x & -x ) ans = min( ans, tree[ x ] ); return ans; }
}F;

inline int change( char a ) {
    if( a == 'A' || a == 'a' || a == 'E' || a == 'e' || a == 'I' || a == 'i' || a == 'O' || a == 'o' ) return -1;
    if( a == 'U' || a == 'u' ) return -1;
    return +2;
}

inline void load( ) {
    scanf( "%s", S + 1 );
    n = strlen( S + 1 );
    OFFSET = 200001;
}

inline void solve( ) {
    int sum = 0;
    int ans = 0, cnt = 0;
    F.add( OFFSET, 0 );
    for( int i = 1; i <= n; i++ ) {
        sum += change( S[ i ] );
       // printf( "sum == %d\n", sum );
        int wh = F.get( sum + OFFSET );
       // printf( "wh == %d\n", wh );
       // system( "pause" );
        if( wh != INF ) {
            if( i - wh > ans ) {
                ans = i - wh;
                cnt = 1;
            }
            else if( i - wh == ans ) cnt++;
        }

        F.add( sum + OFFSET, i );
    }
    if( !ans && !cnt ) printf( "No solution\n" );
    else
    printf( "%d %d\n", ans, cnt );
}

int main( void ) {
    load( );
    solve( );
  //  system( "pause" );
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;

const int N = 200100;
const int INF = 0x3f3f3f3f;

int n;
char S[ N ];
int OFFSET;

struct fenwick {
    int tree[ 400100 ];
    int n;
    fenwick( ) {
        memset( tree, INF, sizeof( tree ) );
        n = 400009;
    }
    inline void add( int x, int val ) { for( ; x < n; x += x & -x ) tree[ x ] = min( tree[ x ], val ); }
    inline int get( int x ) { int ans = INF; for( ; x; x -= x & -x ) ans = min( ans, tree[ x ] ); return ans; }
}F;

inline int change( char a ) {
    if( a == 'A' || a == 'a' || a == 'E' || a == 'e' || a == 'I' || a == 'i' || a == 'O' || a == 'o' ) return -1;
    if( a == 'U' || a == 'u' ) return -1;
    return +2;
}

inline void load( ) {
    scanf( "%s", S + 1 );
    n = strlen( S + 1 );
    OFFSET = 100001;
}

inline void solve( ) {
    int sum = 0;
    int ans = 0, cnt = 0;
    F.add( OFFSET, 0 );
    for( int i = 1; i <= n; i++ ) {
        sum += change( S[ i ] );
       // printf( "sum == %d\n", sum );
        int wh = F.get( sum + OFFSET );
       // printf( "wh == %d\n", wh );
       // system( "pause" );
        if( wh != INF ) {
            if( i - wh > ans ) {
                ans = i - wh;
                cnt = 1;
            }
            else if( i - wh == ans ) cnt++;
        }

        F.add( sum + OFFSET, i );
    }
    if( !ans && !cnt ) printf( "No solution\n" );
    else
    printf( "%d %d\n", ans, cnt );
}

int main( void ) {
    load( );
    solve( );
   // system( "pause" );
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
#include <limits>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <sstream>
using namespace std;
char s[2 * 100005], v[] = {'a', 'e', 'i', 'o', 'u'};
int N, a[2 * 100005], tree[2 * 100005], shift = 2 * 100005, Sum[2 * 100005];
int ans = -1, cnt = 0;
void update(int idx, int val){
    while(idx <= 2 * 100005){
        tree[idx] = min(tree[idx], val);
        idx += idx & (-idx);
    }
}
int query(int idx){
    int ans = 1 << 30;
    while(idx > 0){
        ans = min(ans, tree[idx]);
        idx -= idx & (-idx);
    }
    return ans;
}
int main(){
    scanf("%s", &s);
    N = strlen(s);
    for(int i = 0; i < N; i++){
        a[i] = 2;
        s[i] = tolower(s[i]);
        for(int j = 0; j < 5; j++)
            if(v[j] == s[i])a[i] = -1;
    }
    Sum[0] = a[0];
    for(int i = 1; i < N; i++)
        Sum[i] = Sum[i - 1] + a[i];
    memset(tree, 63, sizeof tree);
    update(shift, 0);
    for(int i = 0; i < N; i++){
        int j = query(Sum[i] + shift);
        if(j < i)ans = max(ans, i - j);
        if(Sum[i] >= 0)ans = max(ans, i + 1);
        update(Sum[i] + shift, i);
    }
    if(ans < 0)printf("No solution\n");
    else{
        for(int i = 0; i < N; i++){
            int j = i + ans - 1;
            if(j < N && Sum[j] - Sum[i] + a[i] >= 0)cnt++;
        }
        printf("%d %d\n", ans, cnt);
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
#include <limits>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <string.h>
#include <assert.h>
#include <numeric>
#define MAXN 200005
using namespace std;
char s[MAXN];
int N, p[MAXN];
bool isvowel(char c){
    c = tolower(c);
    return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
int main(){
    scanf("%s", s);

    N = strlen(s);
    for(int i = 0; i < N; i++){
        if(isvowel(s[i]))p[i] = -1;
        else p[i] = 2;
    }
    vector <int> ans;
    vector < pair <int, int> > v;
    v.push_back(make_pair(0, -1));

    int cur = 0;
    for(int i = 0; i < N; i++){
        cur += p[i];

        int d = v.size();
        for(int j = 20; j >= 0; j--)
            if(d >= (1 << j) && cur >= v[d - (1 << j)].first)d -= 1 << j;

        if(d == v.size())ans.push_back(0);
        else ans.push_back(i - v[d].second);

        if(cur < v.back().first)v.push_back(make_pair(cur, i));
    }

    int best = *max_element(ans.begin(), ans.end());
    int c = count(ans.begin(), ans.end(), best);

    if(best == 0)printf("No solution\n");
    else printf("%d %d\n", best, c);
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
#include <limits>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <string.h>
#include <assert.h>
#include <numeric>
#define MAXN 200005
using namespace std;
char s[MAXN];
int N, p[MAXN], t[4 * MAXN];
bool isvowel(char c){
    c = tolower(c);
    return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
void insert(int i, int L, int R, int v, int k){
    if(v < L || R < v)return;
    if(L == R){
        t[i] = k;
        return;
    }
    int mid = (L + R) / 2;
    insert(2 * i, L, mid, v, k);
    insert(2 * i + 1, mid + 1, R, v, k);

    t[i] = min(t[2 * i], t[2 * i + 1]);
}
int find_best(int i, int L, int R, int k){
    if(L == R){
        if(t[i] <= k)return L;
        else return 1 << 30;
    }
    int mid = (L + R) / 2;
    if(t[2 * i] <= k)return find_best(2 * i, L, mid, k);
    else return find_best(2 * i + 1, mid + 1, R, k);
}
int main(){
    scanf("%s", s);

    N = strlen(s);
    for(int i = 0; i < N; i++){
        if(isvowel(s[i]))p[i] = -1;
        else p[i] = 2;
    }
    vector <int> ans;
    memset(t, 63, sizeof t);
    insert(1, 0, N - 1, 0, 0);

    int cur = 0;
    for(int i = 0; i < N; i++){
        cur += p[i];
        int best = find_best(1, 0, N - 1, cur);

        if(best > i)ans.push_back(0);
        else ans.push_back((i + 1) - best);

        insert(1, 0, N - 1, i + 1, cur);
    }

    int best = *max_element(ans.begin(), ans.end());
    int c = count(ans.begin(), ans.end(), best);

    if(best == 0)printf("No solution\n");
    else printf("%d %d\n", best, c);
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
#include <limits>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <string.h>
#include <assert.h>
#include <numeric>
#define MAXN 200005
using namespace std;
char s[MAXN];
int N, p[MAXN];
pair <int, int> b[MAXN], si[MAXN];
vector <int> ans;
bool isvowel(char c){
    c = tolower(c);
    return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
void merge_sort(int i, int j){
    if(i == j)return;

    int mid = (i + j) / 2;
    merge_sort(i, mid);
    merge_sort(mid + 1, j);

    int en1 = mid + 1, en2 = j + 1, st1 = i, st2 = mid + 1, M = 1 << 30, k = i;
    while(st1 < en1 && st2 < en2){
        if(si[st1] < si[st2]){
            M = min(M, si[st1].second);
            b[k] = si[st1];
            st1++, k++;
        }else{
            b[k] = si[st2];
            if(M < 1 << 30)ans[si[st2].second] = max(ans[si[st2].second], si[st2].second - M);
            st2++, k++;
        }
    }
    while(st1 < en1){
        b[k] = si[st1];
        st1++, k++;
    }
    while(st2 < en2){
        b[k] = si[st2];
        if(M < 1 << 30)ans[si[st2].second] = max(ans[si[st2].second], si[st2].second - M);
        st2++, k++;
    }
    for(int x = i; x <= j; x++)si[x] = b[x];
}
int main(){
    scanf("%s", s);

    N = strlen(s);
    for(int i = 0; i < N; i++){
        if(isvowel(s[i]))p[i] = -1;
        else p[i] = 2;
    }
    si[0] = make_pair(0, 0);
    for(int i = 0; i < N; i++)
        si[i + 1] = make_pair(si[i].first + p[i], i + 1);
    ans.resize(N + 1);
    merge_sort(0, N);

    int best = *max_element(ans.begin(), ans.end());
    int c = count(ans.begin(), ans.end(), best);

    if(best == 0)printf("No solution\n");
    else printf("%d %d\n", best, c);
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
#include <limits>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <sstream>
using namespace std;
char s[2 * 100005], v[] = {'a', 'e', 'i', 'o', 'u'};
int N, a[2 * 100005], tree[4 * 100005], shift = 2 * 100005, Sum[2 * 100005];
int ans = -1, cnt = 0;
void update(int idx, int val){
    while(idx <= 2 * 100005){
        tree[idx] = min(tree[idx], val);
        idx += idx & (-idx);
    }
}
int query(int idx){
    int ans = 1 << 30;
    while(idx > 0){
        ans = min(ans, tree[idx]);
        idx -= idx & (-idx);
    }
    return ans;
}
int main(){
    scanf("%s", &s);
    N = strlen(s);
    for(int i = 0; i < N; i++){
        a[i] = 2;
        s[i] = tolower(s[i]);
        for(int j = 0; j < 5; j++)
            if(v[j] == s[i])a[i] = -1;
    }
    Sum[0] = a[0];
    for(int i = 1; i < N; i++)
        Sum[i] = Sum[i - 1] + a[i];
    memset(tree, 63, sizeof tree);
    update(shift, 0);
    for(int i = 0; i < N; i++){
        int j = query(Sum[i] + shift);
        if(j < i)ans = max(ans, i - j);
        if(Sum[i] >= 0)ans = max(ans, i + 1);
        update(Sum[i] + shift, i);
    }
    if(ans < 0)printf("No solution\n");
    else{
        for(int i = 0; i < N; i++){
            int j = i + ans - 1;
            if(j < N && Sum[j] - Sum[i] + a[i] >= 0)cnt++;
        }
        printf("%d %d\n", ans, cnt);
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
#include <limits>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <string.h>
#include <assert.h>
#include <numeric>
#define MAXN 200005
#define MAXV 2 * MAXN
#define MAXT 2 * MAXV
using namespace std;
char s[MAXN];
int N, p[MAXN];
bool isvowel(char c){
    c = tolower(c);
    return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
struct BIT{
    int t[MAXT];
    void add(int i, int value){
        i++;

        while(i < MAXT){
            t[i] = min(t[i], value);
            i += i & (-i);
        }
    }
    int find_best(int i){
        i++;

        int ret = 1 << 30;
        while(i > 0){
            ret = min(ret, t[i]);
            i -= i & (-i);
        }
        return ret;
    }
} b;
int main(){
    scanf("%s", s);

    N = strlen(s);
    for(int i = 0; i < N; i++){
        if(isvowel(s[i]))p[i] = -1;
        else p[i] = 2;
    }

    memset(b.t, 63, sizeof b.t);
    b.add(MAXV, -1);

    vector <int> ans;
    int cur = 0;
    for(int i = 0; i < N; i++){
        cur += p[i];

        int best = b.find_best(cur + MAXV);
        if(best < i)ans.push_back(i - best);
        else ans.push_back(0);

        b.add(cur + MAXV, i);
    }
    int best = *max_element(ans.begin(), ans.end());
    int c = count(ans.begin(), ans.end(), best);

    if(best == 0)printf("No solution\n");
    else printf("%d %d\n", best, c);
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdio>
#include <map>
#include <cmath>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <string>
#include <cstring>
#define N 200005
#define ll long long
#define eps 1e-7

using namespace std;

int n,m;
struct Node{
	int sum,id;
	friend bool operator<(const Node& a,const Node& b){
		if(a.sum!=b.sum)
			return a.sum<b.sum;
		else
			return a.id<b.id;
	}
}node[N];

int f[N][18],g[N][18];
void initRMQ(int n){
	for(int i=1;i<=n;i++)
		g[i][0]=f[i][0]=node[i].id;

	for(int j=1;j<=log((double)n)/log(2.0);j++)
		for(int i=1;i+(1<<j)-1<=n;i++){
			f[i][j]=min( f[i][j-1] , f[i+(1<<(j-1))][j-1] );
			g[i][j]=max( g[i][j-1] , g[i+(1<<(j-1))][j-1] );
		}
}
int getF(int a,int b){
	int k=(int)(log((double)b-a+1)/log(2.0));
	return min( f[a][k] , f[b-(1<<k)+1][k] );
}
int getG(int a,int b){
	int k=(int)(log((double)b-a+1)/log(2.0));
	return max( g[a][k] , g[b-(1<<k)+1][k] );
}

char s[N];

int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif

	node[0].id=0;
	node[0].sum=0;

	while(scanf("%s",&s[1])!=EOF){
		n=strlen(&s[1]);
		for(int i=1;i<=n;i++){
			node[i].id=i;

			if(isupper(s[i]))
				s[i]=tolower(s[i]);
			if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u')
				node[i].sum=node[i-1].sum-1;
			else
				node[i].sum=node[i-1].sum+2;
		}

		sort(node+1,node+1+n);
		initRMQ(n);

		int maxLen=-1,ans=0;

		for(int i=1;i<=n;i++){
			int val;

			if(i==1){
				if(node[1].sum>=0){
					if(node[1].id>maxLen){
						maxLen=node[i].id;
						ans=1;
					}
				}
				continue;
			}

			val=getF(1,i-1);
			//cout<<i<<":"<<val<<endl;
			if(node[i].id-val>maxLen){
				maxLen=node[i].id-val;
				ans=1;
			}
			else if(node[i].id-val==maxLen)
				ans++;

			if(node[i].sum>=0 && node[i].id>maxLen){
				maxLen=node[i].id;
				ans=1;
			}
			else if(node[i].sum>=0 && node[i].id==maxLen){
				ans++;
			}
		}

		if(maxLen==-1){
			puts("No solution");
			continue;
		}
		printf("%d %d\n",maxLen,ans);
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdio>
#include <map>
#include <cmath>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <string>
#include <cstring>
#define N 200005
#define ll long long
#define eps 1e-7

using namespace std;

int n,m;
struct Node{
	int sum,id;
	friend bool operator<(const Node& a,const Node& b){
		if(a.sum!=b.sum)
			return a.sum<b.sum;
		else
			return a.id<b.id;
	}
}node[N];

int f[N][18],g[N][18];
void initRMQ(int n){
	for(int i=1;i<=n;i++)
		g[i][0]=f[i][0]=node[i].id;

	for(int j=1;j<=log((double)n)/log(2.0);j++)
		for(int i=1;i+(1<<j)-1<=n;i++){
			f[i][j]=min( f[i][j-1] , f[i+(1<<(j-1))][j-1] );
			g[i][j]=max( g[i][j-1] , g[i+(1<<(j-1))][j-1] );
		}
}
int getF(int a,int b){
	int k=(int)(log((double)b-a+1)/log(2.0));
	return min( f[a][k] , f[b-(1<<k)+1][k] );
}
int getG(int a,int b){
	int k=(int)(log((double)b-a+1)/log(2.0));
	return max( g[a][k] , g[b-(1<<k)+1][k] );
}

char s[N];

int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif

	node[0].id=0;
	node[0].sum=0;

	while(scanf("%s",&s[1])!=EOF){
		n=strlen(&s[1]);
		for(int i=1;i<=n;i++){
			node[i].id=i;

			if(isupper(s[i]))
				s[i]=tolower(s[i]);
			if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u')
				node[i].sum=node[i-1].sum-1;
			else
				node[i].sum=node[i-1].sum+2;
		}

		sort(node+1,node+1+n);
		initRMQ(n);

		int maxLen=-1,ans=0;

		for(int i=1;i<=n;i++){
			int val;

			if(i==1){
				if(node[1].sum>=0){
					if(node[1].id>maxLen){
						maxLen=node[i].id;
						ans=1;
					}
				}
				continue;
			}

			val=getF(1,i-1);
			if(abs(node[i].id-val)>maxLen){
				maxLen=abs(node[i].id-val);
				ans=1;
			}
			else if(abs(node[i].id-val)==maxLen)
				ans++;

			if(node[i].sum>=0 && node[i].id>maxLen){
				maxLen=node[i].id;
				ans=1;
			}
			else if(node[i].sum>=0 && node[i].id==maxLen){
				ans++;
			}
		}

		if(maxLen==-1){
			puts("No solution");
			continue;
		}
		printf("%d %d\n",maxLen,ans);
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdio>
#include <map>
#include <cmath>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <string>
#include <cstring>
#define N 200005
#define ll long long
#define eps 1e-7

using namespace std;

int n,m;
struct Node{
	int sum,id;
	friend bool operator<(const Node& a,const Node& b){
		if(a.sum!=b.sum)
			return a.sum<b.sum;
		else
			return a.id<b.id;
	}
}node[N];

int dp[N][18];
void initRMQ(int n){
	for(int i=1;i<=n;i++)
		dp[i][0]=node[i].id;

	for(int j=1;j<=log((double)n)/log(2.0);j++)
		for(int i=1;i+(1<<j)-1<=n;i++)
			dp[i][j]=min( dp[i][j-1] , dp[i+(1<<(j-1))][j-1] );
}
int get(int a,int b){
	int k=(int)(log((double)b-a+1)/log(2.0));
	return min( dp[a][k] , dp[b-(1<<k)+1][k] );
}

char s[N];

int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif

	node[0].id=0;
	node[0].sum=0;

	while(scanf("%s",&s[1])!=EOF){
		n=strlen(&s[1]);
		for(int i=1;i<=n;i++){
			node[i].id=i;

			if(isupper(s[i]))
				s[i]=tolower(s[i]);
			if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u')
				node[i].sum=node[i-1].sum-1;
			else
				node[i].sum=node[i-1].sum+2;
		}

		sort(node+1,node+1+n);
		initRMQ(n);

		int maxLen=-1,ans=0;

		for(int i=1;i<=n;i++){
			int val;

			if(i==1){
				if(node[1].sum>=0)
					val=1;
				else
					val=-1;
			}
			else
				val=get(1,i-1);

			if(val!=-1 && abs(node[i].id-val)>maxLen){
				maxLen=abs(node[i].id-val);
				ans=1;
			}
			else if(val!=-1 && abs(node[i].id-val)==maxLen)
				ans++;
		}

		if(maxLen==-1){
			puts("No solution");
			continue;
		}
		printf("%d %d\n",maxLen,ans);
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdio>
#include <map>
#include <cmath>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <string>
#include <cstring>
#define N 200005
#define ll long long
#define eps 1e-7

using namespace std;

int n,m;
int sum[N]={0};

char s[N];

bool judge(int len){
	for(int i=1;i+len-1<=n;i++){
		int v=sum[i+len-1]-sum[i-1];
		int c=len-v;
		if(v<=c+c)
			return true;
	}
	return false;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif

	while(scanf("%s",&s[1])!=EOF){
		n=strlen(&s[1]);
		for(int i=1;i<=n;i++){
			if(isupper(s[i]))
				s[i]=tolower(s[i]);
			if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u')
				sum[i]=sum[i-1]+1;
			else
				sum[i]=sum[i-1];
		}

		int low=1,up=n,mid,maxLen=-1;
		while(low<=up){
			mid=(low+up)>>1;
			if(judge(mid)){
				maxLen=max(maxLen,mid);
				low=mid+1;
			}
			else
				up=mid-1;
		}

		if(maxLen==-1){
			puts("No solution");
			continue;
		}

		int ans=0,len=maxLen;
		for(int i=1;i+len-1<=n;i++){
			int v=sum[i+len-1]-sum[i-1];
			int c=len-v;
			if(v<=c+c)
				ans++;
		}
		printf("%d %d\n",len,ans);
	}
	return 0;
}


#include <iostream>
#include <string.h>
using namespace std;

#define LIM 600004

string text;
int cum_sum[200005];
int bit[LIM];

void insert(int pos, int val) {
    pos = pos + 200000;
    while (pos) {
        bit[pos] = max(bit[pos], val);
        pos -= (pos&-pos);
    }
}

int find_max(int pos) {
    pos = pos + 200000;
    int ans = -1;
    while (pos < LIM) {
        ans = max(bit[pos], ans);
        pos += (pos&-pos);
    }
    return ans;
}

void clean() {
    int sz = text.size();
    for (int i=0; i<sz; i++) {
        if (text[i]>='A' && text[i]<='Z') {
            text[i] += 'a'-'A';
        }
        switch (text[i]) {
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                text[i] = 'a';
                break;
            default:
                text[i]='b';
        }
    }
}

void print(int n) {
    for (int i=-n; i<=n; i++) {
        cout<<find_max(i)<<" ";
    }
    cout<<endl;
}

int main() {
    cin>>text;
    int sz = text.size();
    clean();
    //cout<<"0 ";
    for (int i=0; i<sz; i++) {
        if (text[i]=='a') {
            cum_sum[i+1] = cum_sum[i] - 1;
        } else {
            cum_sum[i+1] = cum_sum[i] + 2;
        }
        //cout<<cum_sum[i+1]<<" ";
    }
    memset(bit, -1, sizeof(bit));
    int max_len = 0;
    int max_cnt = 0;
    //print(20);
    for (int i=sz-1; i>=0; i--) {
        int req = cum_sum[i];
        int temp = find_max(req);
        //cout<<"req: "<<req<<endl;
        //cout<<i<<" to "<<temp<<endl;
        int len = temp-i+1;
        if (len > max_len) {
            max_len = len;
            max_cnt = 0;
        }
        if (len == max_len) {
            max_cnt++;
        }
        //cout<<"inserting "<<cum_sum[i+1]<<": "<<i<<endl;
        insert(cum_sum[i+1], i);
        //print(20);
    }
    if (max_len)
    cout<<max_len<<" "<<max_cnt<<endl;
    else
        cout<<"No Solution"<<endl;
}


#include <iostream>
#include <string.h>
using namespace std;

#define LIM 1000000

string text;
int cum_sum[200005];
int bit[LIM];

void insert(int pos, int val) {
    pos = pos + 500000;
    while (pos) {
        bit[pos] = max(bit[pos], val);
        pos -= (pos&-pos);
    }
}

int find_max(int pos) {
    pos = pos + 500000;
    int ans = -1;
    while (pos < LIM) {
        ans = max(bit[pos], ans);
        pos += (pos&-pos);
    }
    return ans;
}

void clean() {
    int sz = text.size();
    for (int i=0; i<sz; i++) {
        if (text[i]>='A' && text[i]<='Z') {
            text[i] += 'a'-'A';
        }
        switch (text[i]) {
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                text[i] = 'a';
                break;
            default:
                text[i]='b';
        }
    }
}

void print(int n) {
    for (int i=-n; i<=n; i++) {
        cout<<find_max(i)<<" ";
    }
    cout<<endl;
}

int main() {
    cin>>text;
    int sz = text.size();
    clean();
    //cout<<"0 ";
    for (int i=0; i<sz; i++) {
        if (text[i]=='a') {
            cum_sum[i+1] = cum_sum[i] - 1;
        } else {
            cum_sum[i+1] = cum_sum[i] + 2;
        }
        //cout<<cum_sum[i+1]<<" ";
    }
    memset(bit, -1, sizeof(bit));
    int max_len = 0;
    int max_cnt = 0;
    //print(20);
    for (int i=sz-1; i>=0; i--) {
        int req = cum_sum[i];
        int temp = find_max(req);
        //cout<<"req: "<<req<<endl;
        //cout<<i<<" to "<<temp<<endl;
        int len = temp-i+1;
        if (len > max_len) {
            max_len = len;
            max_cnt = 0;
        }
        if (len == max_len) {
            max_cnt++;
        }
        //cout<<"inserting "<<cum_sum[i+1]<<": "<<i<<endl;
        insert(cum_sum[i+1], i);
        //print(20);
    }
    if (max_len)
    cout<<max_len<<" "<<max_cnt<<endl;
    else
        cout<<"No solution"<<endl;
}


#include <iostream>
#include <string.h>
using namespace std;

#define LIM 600004

string text;
int cum_sum[200005];
int bit[LIM];

void insert(int pos, int val) {
    pos = pos + 200000;
    while (pos) {
        bit[pos] = max(bit[pos], val);
        pos -= (pos&-pos);
    }
}

int find_max(int pos) {
    pos = pos + 200000;
    int ans = -1;
    while (pos < LIM) {
        ans = max(bit[pos], ans);
        pos += (pos&-pos);
    }
    return ans;
}

void clean() {
    int sz = text.size();
    for (int i=0; i<sz; i++) {
        if (text[i]>='A' && text[i]<='Z') {
            text[i] += 'a'-'A';
        }
        switch (text[i]) {
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                text[i] = 'a';
                break;
            default:
                text[i]='b';
        }
    }
}

void print(int n) {
    for (int i=-n; i<=n; i++) {
        cout<<find_max(i)<<" ";
    }
    cout<<endl;
}

int main() {
    cin>>text;
    int sz = text.size();
    clean();
    //cout<<"0 ";
    for (int i=0; i<sz; i++) {
        if (text[i]=='a') {
            cum_sum[i+1] = cum_sum[i] - 1;
        } else {
            cum_sum[i+1] = cum_sum[i] + 2;
        }
        //cout<<cum_sum[i+1]<<" ";
    }
    memset(bit, -1, sizeof(bit));
    int max_len = 0;
    int max_cnt = 0;
    //print(20);
    for (int i=sz-1; i>=0; i--) {
        int req = cum_sum[i];
        int temp = find_max(req);
        //cout<<"req: "<<req<<endl;
        //cout<<i<<" to "<<temp<<endl;
        int len = temp-i+1;
        if (len > max_len) {
            max_len = len;
            max_cnt = 0;
        }
        if (len == max_len) {
            max_cnt++;
        }
        //cout<<"inserting "<<cum_sum[i+1]<<": "<<i<<endl;
        insert(cum_sum[i+1], i);
        //print(20);
    }
    if (max_len)
    cout<<max_len<<" "<<max_cnt<<endl;
    else
        cout<<"No solution"<<endl;
}


#include <iostream>
#include <string.h>
using namespace std;

#define LIM 1000000

string text;
int cum_sum[300005];
int bit[LIM];

void insert(int pos, int val) {
    pos = pos + 500000;
    while (pos) {
        bit[pos] = max(bit[pos], val);
        pos -= (pos&-pos);
    }
}

int find_max(int pos) {
    pos = pos + 500000;
    int ans = -1;
    while (pos < LIM) {
        ans = max(bit[pos], ans);
        pos += (pos&-pos);
    }
    return ans;
}

void clean() {
    int sz = text.size();
    for (int i=0; i<sz; i++) {
        if (text[i]>='A' && text[i]<='Z') {
            text[i] += 'a'-'A';
        }
        switch (text[i]) {
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                text[i] = 'a';
                break;
            default:
                text[i]='b';
        }
    }
}

void print(int n) {
    for (int i=-n; i<=n; i++) {
        cout<<find_max(i)<<" ";
    }
    cout<<endl;
}

int main() {
    cin>>text;
    int sz = text.size();
    clean();
    //cout<<"0 ";
    for (int i=0; i<sz; i++) {
        if (text[i]=='a') {
            cum_sum[i+1] = cum_sum[i] - 1;
        } else {
            cum_sum[i+1] = cum_sum[i] + 2;
        }
        //cout<<cum_sum[i+1]<<" ";
    }
    memset(bit, -1, sizeof(bit));
    int max_len = 0;
    int max_cnt = 0;
    //print(20);
    for (int i=sz-1; i>=0; i--) {
        int req = cum_sum[i];
        int temp = find_max(req);
        //cout<<"req: "<<req<<endl;
        //cout<<i<<" to "<<temp<<endl;
        int len = temp-i+1;
        if (len > max_len) {
            max_len = len;
            max_cnt = 0;
        }
        if (len == max_len) {
            max_cnt++;
        }
        //cout<<"inserting "<<cum_sum[i+1]<<": "<<i<<endl;
        insert(cum_sum[i+1], i);
        //print(20);
    }
    if (max_len)
    cout<<max_len<<" "<<max_cnt<<endl;
    else
        cout<<"No solution"<<endl;
}


#include <iostream>
using namespace std;

string text;

int count(int window) {
    int v=0, c=0;
    for (int i=0; i<window; i++) {
        if (text[i]=='a')v++;
        else c++;
    }
    int ans = 0;
    int sz = text.size();
    //cout<<sz<<endl;
    for (int i=0; i<sz; i++) {
//        cout<<"-----------"<<i+window-1<<endl;
        if (i+window-1 >= sz) {
            break;
        }
        if (i!=0) {
            if (text[i-1]=='a')v--;
            else c--;
            if (text[i+window-1]=='a') v++;
            else c++;
        }
//        cout<<"=====> "<<i<<" :"<<v<<" "<<c<<endl;
        if (v<=2*c) {
            ans++;
        }
    }
    //cout<<window<<" "<<ans<<endl;
    return ans;
}

void clean() {
    int sz = text.size();
    for (int i=0; i<sz; i++) {
        if (text[i]>='A' && text[i]<='Z') {
            text[i] += 'a'-'A';
        }
        switch (text[i]) {
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                text[i] = 'a';
                break;
            default:
                text[i]='b';
        }
    }
}

int main() {
    cin>>text;
    clean();
    //cout<<text<<endl;
    int lo = 0;
    int hi = text.size();
    int w = 0;
    while (lo<=hi) {
        int mid = (lo+hi)/2;
        if (count(mid)) {
            lo = mid+1;
            w = mid;
        } else {
            hi = mid-1;
        }
    }
    if (w)
    cout<<w<<" "<<count(w)<<endl;
    else
    cout<<"No solution"<<endl;
}


#include <iostream>
#include <string.h>
using namespace std;

#define LIM 1000000

string text;
int cum_sum[300005];
int bit[LIM];

void insert(int pos, int val) {
    pos = pos + 500000;
    while (pos) {
        bit[pos] = max(bit[pos], val);
        pos -= (pos&-pos);
    }
}

int find_max(int pos) {
    pos = pos + 500000;
    int ans = -1;
    while (pos < LIM) {
        ans = max(bit[pos], ans);
        pos += (pos&-pos);
    }
    return ans;
}

void clean() {
    int sz = text.size();
    for (int i=0; i<sz; i++) {
        if (text[i]>='A' && text[i]<='Z') {
            text[i] += 'a'-'A';
        }
        switch (text[i]) {
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                text[i] = 'a';
                break;
            default:
                text[i]='b';
        }
    }
}

void print(int n) {
    for (int i=-n; i<=n; i++) {
        cout<<find_max(i)<<" ";
    }
    cout<<endl;
}

int main() {
    cin>>text;
    int sz = text.size();
    clean();
    //cout<<"0 ";
    for (int i=0; i<sz; i++) {
        if (text[i]=='a') {
            cum_sum[i+1] = cum_sum[i] - 1;
        } else {
            cum_sum[i+1] = cum_sum[i] + 2;
        }
        //cout<<cum_sum[i+1]<<" ";
    }
    memset(bit, -1, sizeof(bit));
    int max_len = 0;
    int max_cnt = 0;
    //print(20);
    for (int i=sz-1; i>=0; i--) {
        insert(cum_sum[i+1], i);
        int req = cum_sum[i];
        int temp = find_max(req);
        //cout<<"req: "<<req<<endl;
        //cout<<i<<" to "<<temp<<endl;
        int len = temp-i+1;
        if (len > max_len) {
            max_len = len;
            max_cnt = 0;
        }
        if (len == max_len) {
            max_cnt++;
        }
        //cout<<"inserting "<<cum_sum[i+1]<<": "<<i<<endl;
        //print(20);
    }
    if (max_len)
    cout<<max_len<<" "<<max_cnt<<endl;
    else
        cout<<"No solution"<<endl;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<cstring>
#include<stack>
#include<queue>
#include<cassert>

using namespace std;

#define LL long long int
#define PII pair<int,int>
#define PB push_back
#define MP make_pair
#define INF 1000000000
string s;
int vow[300000],con[300000],res[300000],prev[300000];
map<int,int> mp;
set<PII> st;
set<PII> ::iterator it;
bool isvowel(char c){
	if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U')
		return true;
	return false;
}
int count(int val){
	int i,poss=0;
	if(vow[val-1]<=2*con[val-1])
		poss++;
	for(i=val;i<s.size();i++)
		if((vow[i]-2*con[i])<=(vow[i-val]-2*con[i-val]))
			poss++;
	return poss;
}
int main(){
	int i;
	cin>>s;
	for(i=0;i<s.size();i++){
		if(i!=0){
			vow[i]=vow[i-1];
			con[i]=con[i-1];
		}
		vow[i]+=(isvowel(s[i]));
		con[i]+=(!isvowel(s[i]));
		res[i]=vow[i]-2*con[i];
	}
	st.clear();
	st.insert(MP(0,-1));
	st.insert(MP(1000000000,-2));
	int lb,ub,mid,tmp,ans=-1,ans2=-1,loc;
	lb=1;ub=s.size();
	for(i=0;i<s.size();i++){
		st.insert(MP(res[i],i));
		it=upper_bound(st.begin(),st.end(),MP(res[i],-10));
		if(*it==MP(res[i],i))
			it++;
		loc=it->second;
		if(loc==-2){
			prev[i]=-2;
		}
		else if(loc==-1){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else if(prev[loc]==-2){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else{
			prev[i]=prev[loc];
			if(ans2<i-loc)
				ans2=i-loc;
		}
	}
	if(ans2!=-1)
		printf("%d %d\n",ans2,count(ans2));
	else
		printf("No solution\n");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<cstring>
#include<stack>
#include<queue>
#include<cassert>

using namespace std;

#define LL long long int
#define PII pair<int,int>
#define PB push_back
#define MP make_pair
#define INF 1000000000
string s;
int vow[300000],con[300000],res[300000],prev[300000];
map<int,int> mp;
set<PII> st;
set<PII> ::iterator it;
bool isvowel(char c){
	if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U')
		return true;
	return false;
}
int count(int val){
	int i,poss=0;
	if(vow[val-1]<=2*con[val-1])
		poss++;
	for(i=val;i<s.size();i++)
		if((vow[i]-2*con[i])<=(vow[i-val]-2*con[i-val]))
			poss++;
	return poss;
}
int main(){
	int i;
	cin>>s;
	for(i=0;i<s.size();i++){
		if(i!=0){
			vow[i]=vow[i-1];
			con[i]=con[i-1];
		}
		vow[i]+=(isvowel(s[i]));
		con[i]+=(!isvowel(s[i]));
		res[i]=vow[i]-2*con[i];
	}
	st.clear();
	st.insert(MP(0,-1));
	st.insert(MP(1000000000,-2));
	int lb,ub,mid,tmp,ans=-1,ans2=-1,loc;
	lb=1;ub=s.size();
	for(i=0;i<s.size();i++){
		st.insert(MP(res[i],i));
		it=upper_bound(st.begin(),st.end(),MP(res[i],-10));
		if(*it==MP(res[i],i))
			it++;
		loc=it->second;
		if(loc==-2){
			prev[i]=-2;
		}
		else if(loc==-1){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else if(prev[loc]==-2){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else{
			prev[i]=prev[loc];
			if(ans2<i-prev[loc])
				ans2=i-prev[loc];
		}
	}
	if(ans2!=-1)
		printf("%d %d\n",ans2,count(ans2));
	else
		printf("No solution\n");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<cstring>
#include<stack>
#include<queue>
#include<cassert>

using namespace std;

#define LL long long int
#define PII pair<int,int>
#define PB push_back
#define MP make_pair
#define INF 1000000000
string s;
int vow[300000],con[300000],res[300000],prev[300000];
map<int,int> mp;
set<PII> st;
set<PII> ::iterator it;
bool isvowel(char c){
	if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U')
		return true;
	return false;
}
int count(int val){
	int i,poss=0;
	if(vow[val-1]<=2*con[val-1])
		poss++;
	for(i=val;i<s.size();i++)
		if((vow[i]-2*con[i])<=(vow[i-val]-2*con[i-val]))
			poss++;
	return poss;
}
int main(){
	int i;
	cin>>s;
	for(i=0;i<s.size();i++){
		if(i!=0){
			vow[i]=vow[i-1];
			con[i]=con[i-1];
		}
		vow[i]+=(isvowel(s[i]));
		con[i]+=(!isvowel(s[i]));
		res[i]=vow[i]-2*con[i];
	}
	st.clear();
	st.insert(MP(0,-1));
	st.insert(MP(1000000000,-2));
	int lb,ub,mid,tmp,ans=-1,ans2=-1,loc;
	lb=1;ub=s.size();
	for(i=0;i<s.size();i++){
		st.insert(MP(res[i],i));
		it=upper_bound(st.begin(),st.end(),MP(res[i],-10));
		if(*it==MP(res[i],i))
			it++;
		loc=it->second;
		if(loc==-2){
			prev[i]=-1;
		}
		else if(loc==-1){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;

		}
		else if(prev[loc]==-1){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else{
			prev[i]=prev[loc];
			if(ans2<i-loc)
				ans2=i-loc;
		}
	}
	ans=count(ans2);
	if(ans2!=-1)
		printf("%d %d\n",ans2,ans);
	else
		printf("No solution\n");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<cstring>
#include<stack>
#include<queue>
#include<cassert>

using namespace std;

#define LL long long int
#define PII pair<int,int>
#define PB push_back
#define MP make_pair
#define INF 1000000000
string s;
int vow[300000],con[300000],res[300000],prev[300000];
map<int,int> mp;
set<PII> st;
set<PII> ::iterator it;
bool isvowel(char c){
	if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U')
		return true;
	return false;
}
int count(int val){
	int i,poss=0;
	if(vow[val-1]<=2*con[val-1])
		poss++;
	for(i=val;i<s.size();i++)
		if((vow[i]-2*con[i])<=(vow[i-val]-2*con[i-val]))
			poss++;
	return poss;
}
int main(){
	int i;
	cin>>s;
	for(i=0;i<s.size();i++){
		if(i!=0){
			vow[i]=vow[i-1];
			con[i]=con[i-1];
		}
		vow[i]+=(isvowel(s[i]));
		con[i]+=(!isvowel(s[i]));
		res[i]=vow[i]-2*con[i];
	}
	st.clear();
	st.insert(MP(0,-1));
	st.insert(MP(1000000000,-2));
	int lb,ub,mid,tmp,ans=-1,ans2=-1,loc;
	lb=1;ub=s.size();
	for(i=0;i<s.size();i++){
		st.insert(MP(res[i],i));
		it=upper_bound(st.begin(),st.end(),MP(res[i],-10));
		if(*it==MP(res[i],i))
			it++;
		loc=it->second;
		if(loc==-2){
			prev[i]=-2;
		}
		else if(loc==-1){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else if(prev[loc]==-2){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else{
			prev[i]=prev[loc];
			if(ans2<i-prev[loc])
				ans2=i-loc;
		}
	}
	if(ans2!=-1)
		printf("%d %d\n",ans2,count(ans2));
	else
		printf("No solution\n");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<cstring>
#include<stack>
#include<queue>
#include<cassert>

using namespace std;

#define LL long long int
#define PII pair<int,int>
#define PB push_back
#define MP make_pair
#define INF 1000000000
string s;
int vow[300000],con[300000],res[300000],prev[300000];
map<int,int> mp;
set<PII> st;
set<PII> ::iterator it;
bool isvowel(char c){
	if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U')
		return true;
	return false;
}
int count(int val){
	int i,poss=0;
	if(vow[val-1]<=2*con[val-1])
		poss++;
	for(i=val;i<s.size();i++)
		if((vow[i]-2*con[i])<=(vow[i-val]-2*con[i-val]))
			poss++;
	return poss;
}
int main(){
	int i;
	cin>>s;
	for(i=0;i<s.size();i++){
		if(i!=0){
			vow[i]=vow[i-1];
			con[i]=con[i-1];
		}
		vow[i]+=(isvowel(s[i]));
		con[i]+=(!isvowel(s[i]));
		res[i]=vow[i]-2*con[i];
	}
	st.clear();
	st.insert(MP(0,-1));
	st.insert(MP(1000000000,-2));
	int lb,ub,mid,tmp,ans=-1,ans2=-1,loc;
	lb=1;ub=s.size();
	for(i=0;i<s.size();i++){
		st.insert(MP(res[i],i));
		it=upper_bound(st.begin(),st.end(),MP(res[i],-10));
		if(*it==MP(res[i],i))
			it++;
		loc=it->second;
		if(loc==-2){
			prev[i]=-1;
		}
		else if(loc==-1){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else if(prev[loc]==-2){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else{
			prev[i]=prev[loc];
			if(ans2<i-loc)
				ans2=i-loc;
		}
	}
	if(ans2!=-1)
		printf("%d %d\n",ans2,count(ans2));
	else
		printf("No solution\n");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<cstring>
#include<stack>
#include<queue>
#include<cassert>

using namespace std;

#define LL long long int
#define PII pair<int,int>
#define PB push_back
#define MP make_pair
#define INF 1000000000
string s;
int vow[300000],con[300000];
bool isvowel(char c){
	if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U')
		return true;
	return false;
}
int count(int val){
	int i,poss=0;
	if(vow[val-1]<=2*con[val-1])
		poss++;
	for(i=val;i<s.size();i++)
		if((vow[i]-2*con[i])<=(vow[i-val]-2*con[i-val]))
			poss++;
	return poss;
}
int main(){
	int i;
	cin>>s;
	for(i=0;i<s.size();i++){
		if(i!=0){
			vow[i]=vow[i-1];
			con[i]=con[i-1];
		}
		vow[i]+=(isvowel(s[i]));
		con[i]+=(!isvowel(s[i]));
	}
	int lb,ub,mid,tmp,ans=-1,ans2=-1;
	lb=1;ub=s.size();
	while(lb<=ub){
		mid=((lb+ub)>>1);
		if((tmp=count(mid))!=0){
			lb=mid+1;
			ans=tmp;
			ans2=mid;
		}
		else{
			ub=mid-1;
		}
	}
	if(ans2!=-1)
		printf("%d %d\n",ans2,ans);
	else
		printf("No solution\n");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<cstring>
#include<stack>
#include<queue>
#include<cassert>

using namespace std;

#define LL long long int
#define PII pair<int,int>
#define PB push_back
#define MP make_pair
#define INF 1000000000
string s;
int vow[300000],con[300000],res[300000],prev[300000];
map<int,int> mp;
set<PII> st;
set<PII> ::iterator it;
bool isvowel(char c){
	if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U')
		return true;
	return false;
}
int count(int val){
	int i,poss=0;
	if(vow[val-1]<=2*con[val-1])
		poss++;
	for(i=val;i<s.size();i++)
		if((vow[i]-2*con[i])<=(vow[i-val]-2*con[i-val]))
			poss++;
	return poss;
}
int main(){
	int i;
	cin>>s;
	for(i=0;i<s.size();i++){
		if(i!=0){
			vow[i]=vow[i-1];
			con[i]=con[i-1];
		}
		vow[i]+=(isvowel(s[i]));
		con[i]+=(!isvowel(s[i]));
		res[i]=vow[i]-2*con[i];
	}
	st.clear();
	st.insert(MP(0,-1));
	st.insert(MP(1000000000,-2));
	int lb,ub,mid,tmp,ans=-1,ans2=-1,loc;
	lb=1;ub=s.size();
	for(i=0;i<s.size();i++){
		st.insert(MP(res[i],i));
		it=st.upper_bound(MP(res[i],-10));
		if(*it==MP(res[i],i))
			it++;
		loc=it->second;
		if(loc==-2){
			prev[i]=-2;
		}
		else if(loc==-1){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else if(prev[loc]==-2){
			prev[i]=loc;
			if(ans2<i-loc)
				ans2=i-loc;
		}
		else{
			prev[i]=prev[loc];
			if(ans2<i-prev[loc])
				ans2=i-prev[loc];
		}
	}
	if(ans2!=-1)
		printf("%d %d\n",ans2,count(ans2));
	else
		printf("No solution\n");
	return 0;
}


//==================================================================
//Author        : Nguyen Trung Hieu - vuondenthanhcong11@yahoo.com
//Problem Name  :
//Discription   :
//Reference from:
//==================================================================

// -------------------- Khai bao thu vien --------------------
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <cassert>

#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

// -------------------- Khai bao cac container --------------------
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef pair <int, int> ii;
typedef vector <ii> vii;
typedef vector <string> vs;

typedef long long int64; //NOTES:int64
typedef unsigned long long uint64; //NOTES:uint64
typedef unsigned uint;

const double pi = acos(-1.0); //NOTES:pi
const double eps = 1e-11; //NOTES:eps
const int MAXI = 0x7fffffff;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const char dz[] = "SENW";

// -------------------- Dinh nghia lai cac phep toan --------------------
#define forn(i,a,b)     for (int i=(a),_b=(b); i<_b; i++)
#define rforn(i,b,a)    for (int i=(b)-1,_a=(a); i>=_a; i--)
#define reset(a,b)      memset((a),(b),sizeof(a))

#define endline         putchar('\n')
#define space           putchar(' ')
#define EXIT(x)         {cout << x;return 0;}

#define fi              first
#define se              second
#define pb              push_back
#define all(x)          (x).begin(),(x).end()
#define mp(X,Y)         make_pair(X,Y)
#define foreach(i, c)   for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x)   ((c).find(x) != (c).end())

#define two(x)          (1 << (x))
#define two64(x)        (((int64)(1)) << (x))
#define contain(s, x)   (((s) & two(x)) != 0)
#define contain64(s,x)  (((s) & two64(x)) != 0)

// =========================== Bat dau template ===========================

// -------------------- Cac thao tac nhap - xuat, debug, v.v... --------------------

int in() {
    int x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

int64 in64() {
    int64 x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

void pin(int n) { char buf[33]; int i = 30; if (n < 0) putchar('-'), n = -n; do { buf[i--] = '0'+ n % 10; n /= 10; } while (n); while (i < 30) putchar(buf[++i]); }

void pin64(int64 n) { char buf[55]; int i = 50; if (n < 0) putchar('-'), n = -n; do { buf[i--] = '0'+ n % 10; n /= 10; } while (n); while (i < 50) putchar(buf[++i]); }

// -------------------- Cac ham co ban --------------------

template<class T> inline T checkMod(T n, T m) {
    return (n % m + m) % m;
}

template<class T> inline T multiplyMod(T a, T b, T m) {
    return (T) ((((int64) (a)*(int64) (b) % (int64) (m))+(int64) (m)) % (int64) (m));
}

template<class T> inline T powerMod(T p, int e, T m)
{
    if (e == 0)return 1 % m;
    else if (e % 2 == 0) {
        T t = powerMod(p, e / 2, m);
        return multiplyMod(t, t, m);
    } else return multiplyMod(powerMod(p, e - 1, m), p, m);
}

template<class T> inline bool isPrimeNumber(T n)
{
    if (n <= 1)return false;
    for (T i = 2; i * i <= n; i++) if (n % i == 0) return false;
    return true;
}

template<class T> inline T sqr(T x) {
    return x*x;
}

template<class T> inline T lowbit(T n) {
    return (n^(n - 1))&n;
}

template<class T> inline int countbit(T n) {
    return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}

// -------------------- Cac ham ve toan --------------------

int64 C(int m,int n)
{
    if (n > m) return 0;
    int64 re = 1;
    for(int i = 1; i <= n; i++) re = re * (m - i + 1) / i;
    return re;
}

template<class T> inline T gcd(T a, T b)
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}

template<class T> inline T lcm(T a, T b)
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a * (b / gcd(a, b));
}

template<class T> inline T euclide(T a, T b, T &x, T &y)
{
    if (a < 0) {
        T d = euclide(-a, b, x, y);
        x = -x;
        return d;
    }
    if (b < 0) {
        T d = euclide(a, -b, x, y);
        y = -y;
        return d;
    }
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    } else {
        T d = euclide(b, a % b, x, y);
        T t = x;
        x = y;
        y = t - (a / b) * y;
        return d;
    }
}

template<class T> inline vector<pair<T, int> > factorize(T n)
{
    vector<pair<T, int> > R;
    for (T i = 2; n > 1;) {
        if (n % i == 0) {
            int C = 0;
            for (; n % i == 0; C++, n /= i);
            R.push_back(make_pair(i, C));
        }
        i++;
        if (i > n / i) i = n;
    }
    if (n > 1) R.push_back(make_pair(n, 1));
    return R;
}

template<class T> inline T eularFunction(T n)
{
    vector<pair<T, int> > R = factorize(n);
    T r = n;
    for (int i = 0; i < R.size(); i++)r = r / R[i].first * (R[i].first - 1);
    return r;
}

// -------------------- Cac ham ve ma tran --------------------

const int MaxMatrixSize = 40;

template<class T> inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)cout << A[i][j];
        cout << endl;
    }
}

template<class T> inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}

template<class T> inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}

template<class T> inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}

template<class T> inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}

template<class T> inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}

template<class T> inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}

template<class T> inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}
// -------------------- Cac ham ve hinh hoc --------------------

double dist(ii a, ii b) {
    return sqrt(sqr((double)(a.fi) - (double)(b.fi)) + sqr((double)(a.se) - (double)(b.se)));
}

double distR(ii a, ii b) {
    return sqr((double)(a.fi) - (double)(b.fi)) + sqr((double)(a.se) - (double)(b.se));
}

int cross(ii c, ii a, ii b) {
    return (a.fi - c.fi)*(b.se - c.se)-(b.fi - c.fi)*(a.se - c.se);
}

int crossOper(ii c, ii a, ii b)
{
    double t = (a.fi - c.fi)*(b.se - c.se)-(b.fi - c.fi)*(a.se - c.se);
    if (fabs(t) <= eps) return 0;
    return (t < 0) ? -1 : 1;
}

bool isIntersect(ii a, ii b, ii c, ii d)
{
    return crossOper(a, b, c) * crossOper(a, b, d) < 0 && crossOper(c, d, a) * crossOper(c, d, b) < 0;
}

bool isMiddle(double s, double m, double t) {
    return fabs(s - m) <= eps | fabs(t - m) <= eps | (s < m) != (t < m);
}

// -------------------- Cac ham ve chuyen doi giua cac kieu --------------------

bool isUpperCase(char c) {
    return c >= 'A' && c <= 'Z';
}

bool isLowerCase(char c) {
    return c >= 'a' && c <= 'z';
}

bool isLetter(char c) {
    return c >= 'A' && c <= 'Z' | c >= 'a' && c <= 'z';
}

bool isDigit(char c) {
    return c >= '0' && c <= '9';
}

char toLowerCase(char c) {
    return (isUpperCase(c)) ? (c + 32) : c;
}

char toUpperCase(char c) {
    return (isLowerCase(c)) ? (c - 32) : c;
}

template<class T> string toString(T n) {
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}

int toInt(string s) {
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

int64 toInt64(string s) {
    int64 r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

double toDouble(string s) {
    double r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

template<class T> void stoa(string s, int &n, T A[]) {
    n = 0;
    istringstream sin(s);
    for (T v; sin >> v; A[n++] = v);
}

template<class T> void atos(int n, T A[], string &s) {
    ostringstream sout;
    for (int i = 0; i < n; i++) {
        if (i > 0)sout << ' ';
        sout << A[i];
    }
    s = sout.str();
}

template<class T> void atov(int n, T A[], vector<T> &vi) {
    vi.clear();
    for (int i = 0; i < n; i++) vi.push_back(A[i]);
}

template<class T> void vtoa(vector<T> vi, int &n, T A[]) {
    n = vi.size();
    for (int i = 0; i < n; i++)A[i] = vi[i];
}

template<class T> void stov(string s, vector<T> &vi) {
    vi.clear();
    istringstream sin(s);
    for (T v; sin >> v; vi.push_back(v));
}

template<class T> void vtos(vector<T> vi, string &s) {
    ostringstream sout;
    for (int i = 0; i < vi.size(); i++) {
        if (i > 0)sout << ' ';
        sout << vi[i];
    }
    s = sout.str();
}

// -------------------- Cac ham ve phan so --------------------

template<class T> struct Fraction {
    T a, b;
    Fraction(T a = 0, T b = 1);
    string toString();
};

template<class T> Fraction<T>::Fraction(T a, T b) {
    T d = gcd(a, b);
    a /= d;
    b /= d;
    if (b < 0) a = -a, b = -b;
    this->a = a;
    this->b = b;
}

template<class T> string Fraction<T>::toString() {
    ostringstream sout;
    sout << a << "/" << b;
    return sout.str();
}

template<class T> Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b + q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b - q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.a, p.b * q.b);
}

template<class T> Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b, p.b * q.a);
}
// =========================== Ket thuc template ===========================

#define N 200111

int n, sl[N], pos[N], sum[N];
char s[N];

bool isVowel(char c){
    return (c == 'a' || c == 'o' || c == 'e' || c == 'u' || c == 'i');
}

int main(){
    //freopen ("input.txt", "r", stdin);
    //freopen ("output.txt", "w", stdout);
    gets(s);
    n = strlen(s);

    forn (i, 0, n) s[i] = toLowerCase(s[i]);

    int cnt = 1;
    sl[cnt] = 0;
    pos[cnt] = -1;

    int val, re = -MAXI, reCnt = 0;
    forn (i, 0, n){
        if (isVowel(s[i])) val = -1;
        else val = 2;

        if (i) sum[i] = sum[i - 1] + val;
        else sum[i] = val;

        if (sum[i] < sl[cnt]){
            cnt++;
            sl[cnt] = sum[i];
            pos[cnt] = i;
        }
        else {
            int l = 0, r = cnt, mid;
            while (r - l > 1){
                mid = (r + l) >> 1;
                if (sum[i] >= sl[mid]) r = mid;
                else l = mid;
            }

            if (sl[r] <= sum[i]){
                if (re < i - pos[r]){
                    re = i - pos[r];
                    reCnt = 1;
                }
                else if (re == i - pos[r]) reCnt++;
            }
        }
    }

    if (re != -MAXI) printf ("%d %d", re, reCnt);
    else puts("No solution");
}


//==================================================================
//Author        : Nguyen Trung Hieu - vuondenthanhcong11@yahoo.com
//Problem Name  : 137E - Last Chance
//Discription   :
//Reference from: http://codeforces.com/contest/137/submission/962825
//==================================================================

// -------------------- Khai bao thu vien --------------------
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <cassert>

#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

// -------------------- Khai bao cac container --------------------
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef pair <int, int> ii;
typedef vector <ii> vii;
typedef vector <string> vs;

typedef long long int64; //NOTES:int64
typedef unsigned long long uint64; //NOTES:uint64
typedef unsigned uint;

const double pi = acos(-1.0); //NOTES:pi
const double eps = 1e-11; //NOTES:eps
const int MAXI = 0x7fffffff;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const char dz[] = "SENW";

// -------------------- Dinh nghia lai cac phep toan --------------------
#define FORN(i,a,b)     for (int i=(a),_b=(b); i<_b; i++)
#define RFORN(i,b,a)    for (int i=(b)-1,_a=(a); i>=_a; i--)
#define RESET(a,b)      memset((a),(b),sizeof(a))

#define SC(x)           scanf("%d",&x)
#define SC2(x,y)        scanf("%d %d",&x,&y)
#define PR(x)           printf("%d ",x)
#define PR2(x,y)        printf("%d %d ",x,y)
#define PRS(x)          printf("%s",x)
#define END             printf("\n")
#define EXIT(x)         {PRS(x);return 0;}
#define DBG(x)          {cerr << "--> " << #x << " = " << x << endl;}

#define fi              first
#define se              second
#define PB              push_back
#define ALL(x)          (x).begin(),(x).end()
#define MP(X,Y)         make_pair(X,Y)
#define foreach(i, c)   for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x)   ((c).find(x) != (c).end())

#define two(x)          (1 << (x))
#define two64(x)        (((int64)(1)) << (x))
#define contain(s, x)   (((s) & two(x)) != 0)
#define contain64(s,x)  (((s) & two64(x)) != 0)

// =========================== Bat dau template ===========================

// -------------------- Cac thao tac nhap - xuat, debug, v.v... --------------------
void startDBG(){
    PRS("\n\n------------------- Start Debug -------------------\n\n");
}

void endDBG(){
    PRS("\n\n------------------- End Debug -------------------\n");
}

int in() {
    int x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

int64 in64() {
    int64 x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

void showVi(vi A){
    FORN (i, 0, A.size()) cout << A[i] << " ";
}

void showVii(vii A){
    FORN (i, 0, A.size()) cout << A[i].fi << " " << A[i].se << endl;
}

void showVs(vs A){
    FORN (i, 0, A.size()) cout << A[i] << endl;
}

void showArray(int A[], int n){
    FORN (i, 0, n) cout << A[i] << " ";
}

int MUOI(int x){
    int re = 1;
    FORN (i, 0, x) re *= 10;
    return re + x;
}

vi getVi(int SOLUONG){
    vi REVI;
    FORN (i, 0, SOLUONG){
        int GETA;
        SC(GETA);
        REVI.PB(GETA);
    }
    return REVI;
}

vs getVs(int SOLUONG){
    vs REVS;
    FORN (i, 0, SOLUONG){
        string GETS;
        cin >> GETS;
        REVS.PB(GETS);
    }
    return REVS;
}

vii getVii(int SOLUONG){
    vii REVII;
    FORN (i, 0, SOLUONG){
        int GETA, GETB;
        SC2(GETA, GETB);
        REVII.PB(MP(GETA, GETB));
    }
    return REVII;
}

template<class T> inline T checkMod(T n, T m) {
    return (n % m + m) % m;
}

template<class T> inline T multiplyMod(T a, T b, T m) {
    return (T) ((((int64) (a)*(int64) (b) % (int64) (m))+(int64) (m)) % (int64) (m));
}

template<class T> inline T powerMod(T p, int e, T m)
{
    if (e == 0)return 1 % m;
    else if (e % 2 == 0) {
        T t = powerMod(p, e / 2, m);
        return multiplyMod(t, t, m);
    } else return multiplyMod(powerMod(p, e - 1, m), p, m);
}

template<class T> inline bool isPrimeNumber(T n)
{
    if (n <= 1)return false;
    for (T i = 2; i * i <= n; i++) if (n % i == 0) return false;
    return true;
}

template<class T> inline T sqr(T x) {
    return x*x;
}

template<class T> inline T lowbit(T n) {
    return (n^(n - 1))&n;
}

template<class T> inline int countbit(T n) {
    return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}

// -------------------- Cac ham ve toan --------------------

int64 C(int m,int n)
{
    if (n > m) return 0;
    int64 re = 1;
    for(int i = 1; i <= n; i++) re = re * (m - i + 1) / i;
    return re;
}

template<class T> inline T gcd(T a, T b)
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}

template<class T> inline T lcm(T a, T b)
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a * (b / gcd(a, b));
}

template<class T> inline T euclide(T a, T b, T &x, T &y)
{
    if (a < 0) {
        T d = euclide(-a, b, x, y);
        x = -x;
        return d;
    }
    if (b < 0) {
        T d = euclide(a, -b, x, y);
        y = -y;
        return d;
    }
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    } else {
        T d = euclide(b, a % b, x, y);
        T t = x;
        x = y;
        y = t - (a / b) * y;
        return d;
    }
}

template<class T> inline vector<pair<T, int> > factorize(T n)
{
    vector<pair<T, int> > R;
    for (T i = 2; n > 1;) {
        if (n % i == 0) {
            int C = 0;
            for (; n % i == 0; C++, n /= i);
            R.push_back(make_pair(i, C));
        }
        i++;
        if (i > n / i) i = n;
    }
    if (n > 1) R.push_back(make_pair(n, 1));
    return R;
}

template<class T> inline T eularFunction(T n)
{
    vector<pair<T, int> > R = factorize(n);
    T r = n;
    for (int i = 0; i < R.size(); i++)r = r / R[i].first * (R[i].first - 1);
    return r;
}

// -------------------- Cac ham ve ma tran --------------------

const int MaxMatrixSize = 40;

template<class T> inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)cout << A[i][j];
        cout << endl;
    }
}

template<class T> inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}

template<class T> inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}

template<class T> inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}

template<class T> inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}

template<class T> inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}

template<class T> inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}

template<class T> inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}
// -------------------- Cac ham ve hinh hoc --------------------

double dist(ii a, ii b) {
    return sqrt(sqr((double)(a.fi) - (double)(b.fi)) + sqr((double)(a.se) - (double)(b.se)));
}

double distR(ii a, ii b) {
    return sqr((double)(a.fi) - (double)(b.fi)) + sqr((double)(a.se) - (double)(b.se));
}

int cross(ii c, ii a, ii b) {
    return (a.fi - c.fi)*(b.se - c.se)-(b.fi - c.fi)*(a.se - c.se);
}

int crossOper(ii c, ii a, ii b)
{
    double t = (a.fi - c.fi)*(b.se - c.se)-(b.fi - c.fi)*(a.se - c.se);
    if (fabs(t) <= eps) return 0;
    return (t < 0) ? -1 : 1;
}

bool isIntersect(ii a, ii b, ii c, ii d)
{
    return crossOper(a, b, c) * crossOper(a, b, d) < 0 && crossOper(c, d, a) * crossOper(c, d, b) < 0;
}

bool isMiddle(double s, double m, double t) {
    return fabs(s - m) <= eps | fabs(t - m) <= eps | (s < m) != (t < m);
}

// -------------------- Cac ham ve chuyen doi giua cac kieu --------------------

bool isUpperCase(char c) {
    return c >= 'A' && c <= 'Z';
}

bool isLowerCase(char c) {
    return c >= 'a' && c <= 'z';
}

bool isLetter(char c) {
    return c >= 'A' && c <= 'Z' | c >= 'a' && c <= 'z';
}

bool isDigit(char c) {
    return c >= '0' && c <= '9';
}

char toLowerCase(char c) {
    return (isUpperCase(c)) ? (c + 32) : c;
}

char toUpperCase(char c) {
    return (isLowerCase(c)) ? (c - 32) : c;
}

template<class T> string toString(T n) {
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}

int toInt(string s) {
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

int64 toInt64(string s) {
    int64 r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

double toDouble(string s) {
    double r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

template<class T> void stoa(string s, int &n, T A[]) {
    n = 0;
    istringstream sin(s);
    for (T v; sin >> v; A[n++] = v);
}

template<class T> void atos(int n, T A[], string &s) {
    ostringstream sout;
    for (int i = 0; i < n; i++) {
        if (i > 0)sout << ' ';
        sout << A[i];
    }
    s = sout.str();
}

template<class T> void atov(int n, T A[], vector<T> &vi) {
    vi.clear();
    for (int i = 0; i < n; i++) vi.push_back(A[i]);
}

template<class T> void vtoa(vector<T> vi, int &n, T A[]) {
    n = vi.size();
    for (int i = 0; i < n; i++)A[i] = vi[i];
}

template<class T> void stov(string s, vector<T> &vi) {
    vi.clear();
    istringstream sin(s);
    for (T v; sin >> v; vi.push_back(v));
}

template<class T> void vtos(vector<T> vi, string &s) {
    ostringstream sout;
    for (int i = 0; i < vi.size(); i++) {
        if (i > 0)sout << ' ';
        sout << vi[i];
    }
    s = sout.str();
}

// -------------------- Cac ham ve phan so --------------------

template<class T> struct Fraction {
    T a, b;
    Fraction(T a = 0, T b = 1);
    string toString();
};

template<class T> Fraction<T>::Fraction(T a, T b) {
    T d = gcd(a, b);
    a /= d;
    b /= d;
    if (b < 0) a = -a, b = -b;
    this->a = a;
    this->b = b;
}

template<class T> string Fraction<T>::toString() {
    ostringstream sout;
    sout << a << "/" << b;
    return sout.str();
}

template<class T> Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b + q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b - q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.a, p.b * q.b);
}

template<class T> Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b, p.b * q.a);
}
// =========================== Ket thuc template ===========================

#define N 200005

int n;
char s[N];
int sum[N], sl[N], pos[N];

bool isVowel(char c){
    return (c == 'a' || c == 'o' || c == 'e' || c == 'u' || c == 'i');
}

int main(){
    //freopen ("input.txt", "r", stdin);
    //freopen ("output.txt", "w", stdout);
    gets(s);
    n = strlen(s);

    FORN (i, 0, n) s[i] = toLowerCase(s[i]);

    int cnt = 1, re = -MAXI, val, reCnt = 0;
    int l, r, mid;

    sl[1] = 0;
    pos[1] = -1;

    FORN (i, 0, n){
        if (isVowel(s[i])) val = -1;
        else val = 2;

        if (i == 0) sum[i] = val;
        else sum[i] = sum[i - 1] + val;

        if (sum[i] < sl[cnt]){
            cnt++;
            sl[cnt] = sum[i];
            pos[cnt] = i;
        }
        else {
            l = 0; r = cnt;
            while (r - l > 1){
                mid = (l + r) >> 1;
                if (sum[i] >= sl[mid]) r = mid;
                else l = mid;
            }

            if (sl[r] <= sum[i]){
                if (re < i - pos[r]){
                    re = i - pos[r];
                    reCnt = 1;
                }
                else if (re == i - pos[r]) reCnt++;
            }
        }
    }

    if (re == -MAXI) EXIT("No solution")
    printf("%d %d", re, reCnt);
}


//==================================================================
//Author        : Nguyen Trung Hieu - vuondenthanhcong11@yahoo.com
//Problem Name  : 137E - Last Chance
//Discription   :
//Reference from: http://codeforces.com/contest/137/submission/962825
//==================================================================

// -------------------- Khai bao thu vien --------------------
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <cassert>

#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

// -------------------- Khai bao cac container --------------------
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef pair <int, int> ii;
typedef vector <ii> vii;
typedef vector <string> vs;

typedef long long int64; //NOTES:int64
typedef unsigned long long uint64; //NOTES:uint64
typedef unsigned uint;

const double pi = acos(-1.0); //NOTES:pi
const double eps = 1e-11; //NOTES:eps
const int MAXI = 0x7fffffff;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const char dz[] = "SENW";

// -------------------- Dinh nghia lai cac phep toan --------------------
#define FORN(i,a,b)     for (int i=(a),_b=(b); i<_b; i++)
#define RFORN(i,b,a)    for (int i=(b)-1,_a=(a); i>=_a; i--)
#define RESET(a,b)      memset((a),(b),sizeof(a))

#define SC(x)           scanf("%d",&x)
#define SC2(x,y)        scanf("%d %d",&x,&y)
#define PR(x)           printf("%d ",x)
#define PR2(x,y)        printf("%d %d ",x,y)
#define PRS(x)          printf("%s",x)
#define END             printf("\n")
#define EXIT(x)         {PRS(x);return 0;}
#define DBG(x)          {cerr << "--> " << #x << " = " << x << endl;}

#define fi              first
#define se              second
#define PB              push_back
#define ALL(x)          (x).begin(),(x).end()
#define MP(X,Y)         make_pair(X,Y)
#define foreach(i, c)   for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x)   ((c).find(x) != (c).end())

#define two(x)          (1 << (x))
#define two64(x)        (((int64)(1)) << (x))
#define contain(s, x)   (((s) & two(x)) != 0)
#define contain64(s,x)  (((s) & two64(x)) != 0)

// =========================== Bat dau template ===========================

// -------------------- Cac thao tac nhap - xuat, debug, v.v... --------------------
void startDBG(){
    PRS("\n\n------------------- Start Debug -------------------\n\n");
}

void endDBG(){
    PRS("\n\n------------------- End Debug -------------------\n");
}

int in() {
    int x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

int64 in64() {
    int64 x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

void showVi(vi A){
    FORN (i, 0, A.size()) cout << A[i] << " ";
}

void showVii(vii A){
    FORN (i, 0, A.size()) cout << A[i].fi << " " << A[i].se << endl;
}

void showVs(vs A){
    FORN (i, 0, A.size()) cout << A[i] << endl;
}

void showArray(int A[], int n){
    FORN (i, 0, n) cout << A[i] << " ";
}

int MUOI(int x){
    int re = 1;
    FORN (i, 0, x) re *= 10;
    return re + x;
}

vi getVi(int SOLUONG){
    vi REVI;
    FORN (i, 0, SOLUONG){
        int GETA;
        SC(GETA);
        REVI.PB(GETA);
    }
    return REVI;
}

vs getVs(int SOLUONG){
    vs REVS;
    FORN (i, 0, SOLUONG){
        string GETS;
        cin >> GETS;
        REVS.PB(GETS);
    }
    return REVS;
}

vii getVii(int SOLUONG){
    vii REVII;
    FORN (i, 0, SOLUONG){
        int GETA, GETB;
        SC2(GETA, GETB);
        REVII.PB(MP(GETA, GETB));
    }
    return REVII;
}

template<class T> inline T checkMod(T n, T m) {
    return (n % m + m) % m;
}

template<class T> inline T multiplyMod(T a, T b, T m) {
    return (T) ((((int64) (a)*(int64) (b) % (int64) (m))+(int64) (m)) % (int64) (m));
}

template<class T> inline T powerMod(T p, int e, T m)
{
    if (e == 0)return 1 % m;
    else if (e % 2 == 0) {
        T t = powerMod(p, e / 2, m);
        return multiplyMod(t, t, m);
    } else return multiplyMod(powerMod(p, e - 1, m), p, m);
}

template<class T> inline bool isPrimeNumber(T n)
{
    if (n <= 1)return false;
    for (T i = 2; i * i <= n; i++) if (n % i == 0) return false;
    return true;
}

template<class T> inline T sqr(T x) {
    return x*x;
}

template<class T> inline T lowbit(T n) {
    return (n^(n - 1))&n;
}

template<class T> inline int countbit(T n) {
    return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}

// -------------------- Cac ham ve toan --------------------

int64 C(int m,int n)
{
    if (n > m) return 0;
    int64 re = 1;
    for(int i = 1; i <= n; i++) re = re * (m - i + 1) / i;
    return re;
}

template<class T> inline T gcd(T a, T b)
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}

template<class T> inline T lcm(T a, T b)
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a * (b / gcd(a, b));
}

template<class T> inline T euclide(T a, T b, T &x, T &y)
{
    if (a < 0) {
        T d = euclide(-a, b, x, y);
        x = -x;
        return d;
    }
    if (b < 0) {
        T d = euclide(a, -b, x, y);
        y = -y;
        return d;
    }
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    } else {
        T d = euclide(b, a % b, x, y);
        T t = x;
        x = y;
        y = t - (a / b) * y;
        return d;
    }
}

template<class T> inline vector<pair<T, int> > factorize(T n)
{
    vector<pair<T, int> > R;
    for (T i = 2; n > 1;) {
        if (n % i == 0) {
            int C = 0;
            for (; n % i == 0; C++, n /= i);
            R.push_back(make_pair(i, C));
        }
        i++;
        if (i > n / i) i = n;
    }
    if (n > 1) R.push_back(make_pair(n, 1));
    return R;
}

template<class T> inline T eularFunction(T n)
{
    vector<pair<T, int> > R = factorize(n);
    T r = n;
    for (int i = 0; i < R.size(); i++)r = r / R[i].first * (R[i].first - 1);
    return r;
}

// -------------------- Cac ham ve ma tran --------------------

const int MaxMatrixSize = 40;

template<class T> inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)cout << A[i][j];
        cout << endl;
    }
}

template<class T> inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}

template<class T> inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}

template<class T> inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}

template<class T> inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}

template<class T> inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}

template<class T> inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}

template<class T> inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}
// -------------------- Cac ham ve hinh hoc --------------------

double dist(ii a, ii b) {
    return sqrt(sqr((double)(a.fi) - (double)(b.fi)) + sqr((double)(a.se) - (double)(b.se)));
}

double distR(ii a, ii b) {
    return sqr((double)(a.fi) - (double)(b.fi)) + sqr((double)(a.se) - (double)(b.se));
}

int cross(ii c, ii a, ii b) {
    return (a.fi - c.fi)*(b.se - c.se)-(b.fi - c.fi)*(a.se - c.se);
}

int crossOper(ii c, ii a, ii b)
{
    double t = (a.fi - c.fi)*(b.se - c.se)-(b.fi - c.fi)*(a.se - c.se);
    if (fabs(t) <= eps) return 0;
    return (t < 0) ? -1 : 1;
}

bool isIntersect(ii a, ii b, ii c, ii d)
{
    return crossOper(a, b, c) * crossOper(a, b, d) < 0 && crossOper(c, d, a) * crossOper(c, d, b) < 0;
}

bool isMiddle(double s, double m, double t) {
    return fabs(s - m) <= eps | fabs(t - m) <= eps | (s < m) != (t < m);
}

// -------------------- Cac ham ve chuyen doi giua cac kieu --------------------

bool isUpperCase(char c) {
    return c >= 'A' && c <= 'Z';
}

bool isLowerCase(char c) {
    return c >= 'a' && c <= 'z';
}

bool isLetter(char c) {
    return c >= 'A' && c <= 'Z' | c >= 'a' && c <= 'z';
}

bool isDigit(char c) {
    return c >= '0' && c <= '9';
}

char toLowerCase(char c) {
    return (isUpperCase(c)) ? (c + 32) : c;
}

char toUpperCase(char c) {
    return (isLowerCase(c)) ? (c - 32) : c;
}

template<class T> string toString(T n) {
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}

int toInt(string s) {
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

int64 toInt64(string s) {
    int64 r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

double toDouble(string s) {
    double r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

template<class T> void stoa(string s, int &n, T A[]) {
    n = 0;
    istringstream sin(s);
    for (T v; sin >> v; A[n++] = v);
}

template<class T> void atos(int n, T A[], string &s) {
    ostringstream sout;
    for (int i = 0; i < n; i++) {
        if (i > 0)sout << ' ';
        sout << A[i];
    }
    s = sout.str();
}

template<class T> void atov(int n, T A[], vector<T> &vi) {
    vi.clear();
    for (int i = 0; i < n; i++) vi.push_back(A[i]);
}

template<class T> void vtoa(vector<T> vi, int &n, T A[]) {
    n = vi.size();
    for (int i = 0; i < n; i++)A[i] = vi[i];
}

template<class T> void stov(string s, vector<T> &vi) {
    vi.clear();
    istringstream sin(s);
    for (T v; sin >> v; vi.push_back(v));
}

template<class T> void vtos(vector<T> vi, string &s) {
    ostringstream sout;
    for (int i = 0; i < vi.size(); i++) {
        if (i > 0)sout << ' ';
        sout << vi[i];
    }
    s = sout.str();
}

// -------------------- Cac ham ve phan so --------------------

template<class T> struct Fraction {
    T a, b;
    Fraction(T a = 0, T b = 1);
    string toString();
};

template<class T> Fraction<T>::Fraction(T a, T b) {
    T d = gcd(a, b);
    a /= d;
    b /= d;
    if (b < 0) a = -a, b = -b;
    this->a = a;
    this->b = b;
}

template<class T> string Fraction<T>::toString() {
    ostringstream sout;
    sout << a << "/" << b;
    return sout.str();
}

template<class T> Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b + q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b - q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.a, p.b * q.b);
}

template<class T> Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b, p.b * q.a);
}
// =========================== Ket thuc template ===========================

#define N 200005

int n;
char s[N];
int sum[N], sl[N], pos[N];

bool isVowel(char c){
    return (c == 'a' || c == 'o' || c == 'e' || c == 'u' || c == 'i' || c == 'y');
}

int main(){
    //freopen ("input.txt", "r", stdin);
    //freopen ("output.txt", "w", stdout);
    gets(s);
    n = strlen(s);

    FORN (i, 0, n) s[i] = toLowerCase(s[i]);

    int cnt = 1, re = -MAXI, val, reCnt = 0;
    int l, r, mid;

    sl[1] = 0;
    pos[1] = -1;

    FORN (i, 0, n){
        if (isVowel(s[i])) val = -1;
        else val = 2;

        if (i == 0) sum[i] = val;
        else sum[i] = sum[i - 1] + val;

        if (sum[i] < sl[cnt]){
            cnt++;
            sl[cnt] = sum[i];
            pos[cnt] = i;
        }
        else {
            l = 0; r = cnt;
            while (r - l > 1){
                mid = (l + r) >> 1;
                if (sum[i] >= sl[mid]) r = mid;
                else l = mid;
            }

            if (sl[r] <= sum[i]){
                if (re < i - pos[r]){
                    re = i - pos[r];
                    reCnt = 1;
                }
                else if (re == i - pos[r]) reCnt++;
            }
        }
    }

    if (re == -MAXI) EXIT("No solution")
    printf("%d %d", re, reCnt);
}


//==================================================================
//Author        : Nguyen Trung Hieu - vuondenthanhcong11@yahoo.com
//Problem Name  :
//Discription   :
//Reference from:
//==================================================================

// -------------------- Khai bao thu vien --------------------
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <cassert>

#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

// -------------------- Khai bao cac container --------------------
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef pair <int, int> ii;
typedef vector <ii> vii;
typedef vector <string> vs;

typedef long long int64; //NOTES:int64
typedef unsigned long long uint64; //NOTES:uint64
typedef unsigned uint;

const double pi = acos(-1.0); //NOTES:pi
const double eps = 1e-11; //NOTES:eps
const int MAXI = 0x7fffffff;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const char dz[] = "SENW";

// -------------------- Dinh nghia lai cac phep toan --------------------
#define forn(i,a,b)     for (int i=(a),_b=(b); i<_b; i++)
#define rforn(i,b,a)    for (int i=(b)-1,_a=(a); i>=_a; i--)
#define reset(a,b)      memset((a),(b),sizeof(a))

#define endline         putchar('\n')
#define space           putchar(' ')
#define EXIT(x)         {cout << x;return 0;}

#define fi              first
#define se              second
#define pb              push_back
#define all(x)          (x).begin(),(x).end()
#define mp(X,Y)         make_pair(X,Y)
#define foreach(i, c)   for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x)   ((c).find(x) != (c).end())

#define two(x)          (1 << (x))
#define two64(x)        (((int64)(1)) << (x))
#define contain(s, x)   (((s) & two(x)) != 0)
#define contain64(s,x)  (((s) & two64(x)) != 0)

// =========================== Bat dau template ===========================

// -------------------- Cac thao tac nhap - xuat, debug, v.v... --------------------

int in() {
    int x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

int64 in64() {
    int64 x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

void pin(int n) { char buf[33]; int i = 30; if (n < 0) putchar('-'), n = -n; do { buf[i--] = '0'+ n % 10; n /= 10; } while (n); while (i < 30) putchar(buf[++i]); }

void pin64(int64 n) { char buf[55]; int i = 50; if (n < 0) putchar('-'), n = -n; do { buf[i--] = '0'+ n % 10; n /= 10; } while (n); while (i < 50) putchar(buf[++i]); }

// -------------------- Cac ham co ban --------------------

template<class T> inline T checkMod(T n, T m) {
    return (n % m + m) % m;
}

template<class T> inline T multiplyMod(T a, T b, T m) {
    return (T) ((((int64) (a)*(int64) (b) % (int64) (m))+(int64) (m)) % (int64) (m));
}

template<class T> inline T powerMod(T p, int e, T m)
{
    if (e == 0)return 1 % m;
    else if (e % 2 == 0) {
        T t = powerMod(p, e / 2, m);
        return multiplyMod(t, t, m);
    } else return multiplyMod(powerMod(p, e - 1, m), p, m);
}

template<class T> inline bool isPrimeNumber(T n)
{
    if (n <= 1)return false;
    for (T i = 2; i * i <= n; i++) if (n % i == 0) return false;
    return true;
}

template<class T> inline T sqr(T x) {
    return x*x;
}

template<class T> inline T lowbit(T n) {
    return (n^(n - 1))&n;
}

template<class T> inline int countbit(T n) {
    return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}

// -------------------- Cac ham ve toan --------------------

int64 C(int m,int n)
{
    if (n > m) return 0;
    int64 re = 1;
    for(int i = 1; i <= n; i++) re = re * (m - i + 1) / i;
    return re;
}

template<class T> inline T gcd(T a, T b)
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}

template<class T> inline T lcm(T a, T b)
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a * (b / gcd(a, b));
}

template<class T> inline T euclide(T a, T b, T &x, T &y)
{
    if (a < 0) {
        T d = euclide(-a, b, x, y);
        x = -x;
        return d;
    }
    if (b < 0) {
        T d = euclide(a, -b, x, y);
        y = -y;
        return d;
    }
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    } else {
        T d = euclide(b, a % b, x, y);
        T t = x;
        x = y;
        y = t - (a / b) * y;
        return d;
    }
}

template<class T> inline vector<pair<T, int> > factorize(T n)
{
    vector<pair<T, int> > R;
    for (T i = 2; n > 1;) {
        if (n % i == 0) {
            int C = 0;
            for (; n % i == 0; C++, n /= i);
            R.push_back(make_pair(i, C));
        }
        i++;
        if (i > n / i) i = n;
    }
    if (n > 1) R.push_back(make_pair(n, 1));
    return R;
}

template<class T> inline T eularFunction(T n)
{
    vector<pair<T, int> > R = factorize(n);
    T r = n;
    for (int i = 0; i < R.size(); i++)r = r / R[i].first * (R[i].first - 1);
    return r;
}

// -------------------- Cac ham ve ma tran --------------------

const int MaxMatrixSize = 40;

template<class T> inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)cout << A[i][j];
        cout << endl;
    }
}

template<class T> inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}

template<class T> inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}

template<class T> inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}

template<class T> inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}

template<class T> inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}

template<class T> inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}

template<class T> inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}
// -------------------- Cac ham ve hinh hoc --------------------

double dist(ii a, ii b) {
    return sqrt(sqr((double)(a.fi) - (double)(b.fi)) + sqr((double)(a.se) - (double)(b.se)));
}

double distR(ii a, ii b) {
    return sqr((double)(a.fi) - (double)(b.fi)) + sqr((double)(a.se) - (double)(b.se));
}

int cross(ii c, ii a, ii b) {
    return (a.fi - c.fi)*(b.se - c.se)-(b.fi - c.fi)*(a.se - c.se);
}

int crossOper(ii c, ii a, ii b)
{
    double t = (a.fi - c.fi)*(b.se - c.se)-(b.fi - c.fi)*(a.se - c.se);
    if (fabs(t) <= eps) return 0;
    return (t < 0) ? -1 : 1;
}

bool isIntersect(ii a, ii b, ii c, ii d)
{
    return crossOper(a, b, c) * crossOper(a, b, d) < 0 && crossOper(c, d, a) * crossOper(c, d, b) < 0;
}

bool isMiddle(double s, double m, double t) {
    return fabs(s - m) <= eps | fabs(t - m) <= eps | (s < m) != (t < m);
}

// -------------------- Cac ham ve chuyen doi giua cac kieu --------------------

bool isUpperCase(char c) {
    return c >= 'A' && c <= 'Z';
}

bool isLowerCase(char c) {
    return c >= 'a' && c <= 'z';
}

bool isLetter(char c) {
    return c >= 'A' && c <= 'Z' | c >= 'a' && c <= 'z';
}

bool isDigit(char c) {
    return c >= '0' && c <= '9';
}

char toLowerCase(char c) {
    return (isUpperCase(c)) ? (c + 32) : c;
}

char toUpperCase(char c) {
    return (isLowerCase(c)) ? (c - 32) : c;
}

template<class T> string toString(T n) {
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}

int toInt(string s) {
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

int64 toInt64(string s) {
    int64 r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

double toDouble(string s) {
    double r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}

template<class T> void stoa(string s, int &n, T A[]) {
    n = 0;
    istringstream sin(s);
    for (T v; sin >> v; A[n++] = v);
}

template<class T> void atos(int n, T A[], string &s) {
    ostringstream sout;
    for (int i = 0; i < n; i++) {
        if (i > 0)sout << ' ';
        sout << A[i];
    }
    s = sout.str();
}

template<class T> void atov(int n, T A[], vector<T> &vi) {
    vi.clear();
    for (int i = 0; i < n; i++) vi.push_back(A[i]);
}

template<class T> void vtoa(vector<T> vi, int &n, T A[]) {
    n = vi.size();
    for (int i = 0; i < n; i++)A[i] = vi[i];
}

template<class T> void stov(string s, vector<T> &vi) {
    vi.clear();
    istringstream sin(s);
    for (T v; sin >> v; vi.push_back(v));
}

template<class T> void vtos(vector<T> vi, string &s) {
    ostringstream sout;
    for (int i = 0; i < vi.size(); i++) {
        if (i > 0)sout << ' ';
        sout << vi[i];
    }
    s = sout.str();
}

// -------------------- Cac ham ve phan so --------------------

template<class T> struct Fraction {
    T a, b;
    Fraction(T a = 0, T b = 1);
    string toString();
};

template<class T> Fraction<T>::Fraction(T a, T b) {
    T d = gcd(a, b);
    a /= d;
    b /= d;
    if (b < 0) a = -a, b = -b;
    this->a = a;
    this->b = b;
}

template<class T> string Fraction<T>::toString() {
    ostringstream sout;
    sout << a << "/" << b;
    return sout.str();
}

template<class T> Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b + q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b - q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.a, p.b * q.b);
}

template<class T> Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b, p.b * q.a);
}
// =========================== Ket thuc template ===========================

#define N 200111

int n, sl[N], pos[N], sum[N];
char s[N];

bool isVowel(char c){
    return (c == 'a' || c == 'o' || c == 'e' || c == 'u' || c == 'i');
}

int main(){
    //freopen ("input.txt", "r", stdin);
    //freopen ("output.txt", "w", stdout);
    gets(s);
    n = strlen(s);

    forn (i, 0, n) s[i] = toLowerCase(s[i]);

    int cnt = 1;
    sl[cnt] = 0;
    pos[cnt] = -1;

    int val, re = -MAXI, reCnt = 0;
    int l, r, mid;
    forn (i, 0, n){
        if (isVowel(s[i])) val = -1;
        else val = 2;

        if (i) sum[i] = sum[i - 1] + val;
        else sum[i] = val;

        if (sum[i] < sl[cnt]){
            cnt++;
            sl[cnt] = sum[i];
            pos[cnt] = i;
        }
        else {
            l = 0, r = cnt;
            while (r - l > 1){
                mid = (r + l) >> 1;
                if (sum[i] >= sl[mid]) r = mid;
                else l = mid;
            }

            if (sl[r] <= sum[i]){
                if (re < i - pos[r]){
                    re = i - pos[r];
                    reCnt = 1;
                }
                else if (re == i - pos[r]) reCnt++;
            }
        }
    }

    if (re != -MAXI) printf ("%d %d", re, reCnt);
    else puts("No solution");
}