#include<bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,b,a) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define SZ(v) (int)v.size()
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define mem(s,v) memset(s,v,sizeof(s))
#define ppc(x) __builtin_popcount((x))
#define iter(it,s) for(__typeof(s.begin())it = s.begin();it!=s.end();it++)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pi> vpi;

const int OO = (int) 2e9;
const double eps = 1e-9;

// 1 based
int daysInMonths[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int di[] = { -1, 0, 1, 0 };
int dj[] = { 0, 1, 0, -1 };
#define Nd 0
#define Ed 1
#define Sd 2
#define Wd 3

int x, n, m, p, v, dp[100002][20], depth[100002];
vector<int> g[100002];
vector<int> nodesAt[100002];
vector<int> roots;
int nbr[100002];
int mpp[100002], r[1000002];
int cnt;

void dfs(int u, int parent, int root){
    dp[u][0] = parent;
    for(int i = 0; i < g[u].size(); i++){
        int v = g[u][i];
        if(v == parent) continue;
        depth[v] = depth[u] + 1;
        nbr[root]++;
        mpp[v] = ++cnt;
        nodesAt[depth[v]].pb(mpp[v]);
        r[v] = root;
        dfs(v, u, root);
    }
}

int ans(int v, int p){
    int rem = p;
    int u = v;
    for(int k = 19; k >= 0; k--){
        if(rem - (1<<k) >= 0){
            u = dp[u][1<<k - 1];
            rem -= (1<<k);
        }
    }

    if(u == -1)
        return 0;
    //printf("size  at depth %d : %d\n", depth[v], nodesAt[depth[v]].size());
    /*for(int i = 0; i < nodesAt[depth[v]].size(); i++){
        printf("%d ", nodesAt[depth[v]][i]);
    }
    printf("\n");*/
   // printf("%d %d\n", r[v], nbr[r[v]]);
    int ans = upper_bound(all(nodesAt[depth[v]]), r[v]+nbr[r[v]]) - lower_bound(all(nodesAt[depth[v]]), r[v]) - 1;
    return ans;

}

int main(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("in.txt", "rt", stdin);
	//	freopen("out.out", "wt", stdout);
#endif

    scanf("%d", &n);
    for(int i = 1; i <= n; i++){
        scanf("%d", &x);
        if(x == 0){
            roots.push_back(i);
            continue;
        }
        g[i].pb(x);
        g[x].pb(i);
    }

    memset(dp, -1, sizeof dp);

    for(int i = 0; i < roots.size(); i++){
        cnt = roots[i];
        dfs(roots[i], -1, roots[i]);
    }

    for(int k = 1; k <= 19; k++){
        for(int u = 1; u <= n; u++){
            if(dp[u][k-1] == -1) continue;
            dp[u][k] = dp[dp[u][k-1]][k-1];
        }
    }

    scanf("%d", &m);
    while(m--){
        scanf("%d%d", &v, &p);
        printf("%d\n",ans(v, p));
    }

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,b,a) for(int i=(a);i>=(b);i--)
#define pb push_back
#define SZ(v) (int)v.size()
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define mem(s,v) memset(s,v,sizeof(s))
#define ppc(x) __builtin_popcount((x))
#define iter(it,s) for(__typeof(s.begin())it = s.begin();it!=s.end();it++)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pi> vpi;

const int OO = (int) 2e9;
const double eps = 1e-9;

// 1 based
int daysInMonths[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int di[] = { -1, 0, 1, 0 };
int dj[] = { 0, 1, 0, -1 };
#define Nd 0
#define Ed 1
#define Sd 2
#define Wd 3

int n, x, y, m, sum, cnt, dp[100002][17], depth[100002], sz[100002], mp[100002];
vector<int> adj[100002], nodesAt[100002], root;

int dfs(int u, int p){
    dp[u][0] = p;
    for(int i = 0; i < adj[u].size(); i++){
        int v = adj[u][i];
        if(v == p) continue;
        mp[v]= ++cnt;
        depth[v] = depth[u] + 1;
        nodesAt[depth[v]].pb(mp[v]);
        sum += dfs(v, u);
    }
    return sz[u] = sum + 1;
}

int getAns(int u, int p){

    int u1 = u;

    for(int k = 17; k >=0; k--){
        if(depth[u] - (1<<k) >= depth[u] - p)
            u = dp[u][k];
    }

    int ans = lower_bound(all(nodesAt[depth[u1]]), mp[u]+sz[u]) - lower_bound(all(nodesAt[depth[u1]]), mp[u]) - 1;
    if(ans < 0)
        ans = 0;
    return ans;
}

int main(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("in.txt", "rt", stdin);
	//	freopen("out.out", "wt", stdout);
#endif

    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> x;
        if(x == 0){
            root.pb(i);
            continue;
        }
        adj[x].pb(i);
        adj[i].pb(x);
    }

    memset(dp, -1, sizeof dp);

    for(int i = 0; i < root.size(); i++){
        mp[root[i]] = ++cnt;
        dfs(root[i], -1);
    }

    for(int k = 1; k <= 17; k++){
        for(int u = 1; u <= n; u++){
            if(dp[u][k-1] == -1) continue;
            dp[u][k] = dp[dp[u][k-1]][k-1];
        }
    }

    cin >> m;
    while(m--){
        cin >> x >> y;
        cout << getAns(x, y) << " ";
    }

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,b,a) for(int i=(a);i>=(b);i--)
#define pb push_back
#define SZ(v) (int)v.size()
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define mem(s,v) memset(s,v,sizeof(s))
#define ppc(x) __builtin_popcount((x))
#define iter(it,s) for(__typeof(s.begin())it = s.begin();it!=s.end();it++)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pi> vpi;

const int OO = (int) 2e9;
const double eps = 1e-9;

// 1 based
int daysInMonths[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int di[] = { -1, 0, 1, 0 };
int dj[] = { 0, 1, 0, -1 };
#define Nd 0
#define Ed 1
#define Sd 2
#define Wd 3

int n, x, y, m, cnt, dp[100002][17], depth[100002], sz[100002], mp[100002];
vector<int> adj[100002], nodesAt[100002], root;

int dfs(int u, int p){
    dp[u][0] = p;
    int sum = 0;
    for(int i = 0; i < adj[u].size(); i++){
        int v = adj[u][i];
        if(v == p) continue;
        mp[v]= ++cnt;
        depth[v] = depth[u] + 1;
        nodesAt[depth[v]].pb(mp[v]);
        sum += dfs(v, u);
    }
    return sz[u] = sum + 1;
}

int getAns(int u, int p){

    int u1 = u;

    for(int k = 17; k >=0; k--){
        if(depth[u] - (1<<k) > depth[u] - p)
            u = dp[u][k];
    }
    u = dp[u][0];
    int ans = upper_bound(all(nodesAt[depth[u1]]), mp[u]+sz[u]) - lower_bound(all(nodesAt[depth[u1]]), mp[u]) - 1;
    if(ans < 0)
        ans = 0;
    return ans;
}

int main(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("in.txt", "rt", stdin);
	//	freopen("out.out", "wt", stdout);
#endif

    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> x;
        if(x == 0){
            root.pb(i);
            continue;
        }
        adj[x].pb(i);
        adj[i].pb(x);
    }

    memset(dp, -1, sizeof dp);

    for(int i = 0; i < root.size(); i++){
        mp[root[i]] = ++cnt;
        dfs(root[i], -1);
    }

    for(int k = 1; k <= 17; k++){
        for(int u = 1; u <= n; u++){
            if(dp[u][k-1] == -1) continue;
            dp[u][k] = dp[dp[u][k-1]][k-1];
        }
    }

    cin >> m;
    while(m--){
        cin >> x >> y;
        cout << getAns(x, y) << " ";
    }

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,b,a) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define SZ(v) (int)v.size()
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define mem(s,v) memset(s,v,sizeof(s))
#define ppc(x) __builtin_popcount((x))
#define iter(it,s) for(__typeof(s.begin())it = s.begin();it!=s.end();it++)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pi> vpi;

const int OO = (int) 2e9;
const double eps = 1e-9;

// 1 based
int daysInMonths[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int di[] = { -1, 0, 1, 0 };
int dj[] = { 0, 1, 0, -1 };
#define Nd 0
#define Ed 1
#define Sd 2
#define Wd 3

int x, n, m, p, v, dp[100002][20], depth[100002];
vector<int> g[100002];
vector<int> nodesAt[100002];
vector<int> roots;
int mpp[100002];
int sizes[100002];
int cnt, sum;

void dfs(int u, int parent){
    dp[u][0] = parent;
    for(int i = 0; i < g[u].size(); i++){
        int v = g[u][i];
        if(v == parent) continue;
        depth[v] = depth[u] + 1;
        mpp[v] = ++cnt;
        nodesAt[depth[v]].pb(mpp[v]);
        dfs(v, u);
    }
}

int dfs2(int u, int parent){
    int sum = 0;
    for(int i = 0; i < g[u].size(); i++){
        int v = g[u][i];
        if(v == parent) continue;
        sum += dfs2(v, u);
    }
    return sizes[u] = sum+1;
}

int ans(int v, int p){
    int rem = p;
    int u = v;
    for(int k = 19; k >= 0; k--){
        if(rem >= (1<<k)){
            if(u == -1) continue;
            u = dp[u][k];
            rem -= (1<<k);
        }
    }

    if(u == -1)
        return 0;
    //printf("size  at depth %d : %d\n", depth[v], nodesAt[depth[v]].size());
   /* printf("depth[v] : %d,  %d %d %d : \n", depth[v], u, mpp[u], sizes[u]);
    for(int i = 0; i < nodesAt[depth[v]].size(); i++){
        printf("%d ", nodesAt[depth[v]][i]);
    }
    printf("\n");*/
   // printf("%d %d\n", r[v], nbr[r[v]]);
   //printf("|%d %d %d|\n", u, mpp[u], sizes[u]);
    int ans =  upper_bound(all(nodesAt[depth[v]]), mpp[u] + sizes[u]-1) - lower_bound(all(nodesAt[depth[v]]), mpp[u]) - 1;
    if(ans <= 0)
        return 0;
    return ans;
}

int main(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("in.txt", "rt", stdin);
	//	freopen("out.out", "wt", stdout);
#endif

    scanf("%d", &n);
    for(int i = 1; i <= n; i++){
        scanf("%d", &x);
        if(x == 0){
            roots.push_back(i);
            continue;
        }
        g[i].pb(x);
        g[x].pb(i);
    }

    memset(dp, -1, sizeof dp);

    for(int i = 0; i < roots.size(); i++){
        mpp[roots[i]] = ++cnt;
        dfs(roots[i], -1);
        dfs2(roots[i], -1);
    }

    for(int k = 1; k <= 19; k++){
        for(int u = 1; u <= n; u++){
            if(dp[u][k-1] == -1) continue;
            dp[u][k] = dp[dp[u][k-1]][k-1];
        }
    }
    //for(int i = 1; i <= n; i++)
      //  printf("u:%d, mpp[u]:%d\n", i, mpp[i]);
    //printf("%d\n", sizes[6], sizes[7]);
    scanf("%d", &m);
    while(m--){
        scanf("%d%d", &v, &p);
        printf("%d ",ans(v, p));
    }

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,b,a) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define SZ(v) (int)v.size()
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define mem(s,v) memset(s,v,sizeof(s))
#define ppc(x) __builtin_popcount((x))
#define iter(it,s) for(__typeof(s.begin())it = s.begin();it!=s.end();it++)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pi> vpi;

const int OO = (int) 2e9;
const double eps = 1e-9;

// 1 based
int daysInMonths[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int di[] = { -1, 0, 1, 0 };
int dj[] = { 0, 1, 0, -1 };
#define Nd 0
#define Ed 1
#define Sd 2
#define Wd 3

int x, n, m, p, v, dp[100002][20], depth[100002];
vector<int> g[100002];
vector<int> nodesAt[100002];
vector<int> roots;
int mpp[100002];
int sizes[100002];
int cnt, sum;

int dfs(int u, int parent){
    dp[u][0] = parent;
    int sum = 0;
    for(int i = 0; i < g[u].size(); i++){
        int v = g[u][i];
        if(v == parent) continue;
        depth[v] = depth[u] + 1;
        mpp[v] = ++cnt;
        nodesAt[depth[v]].pb(mpp[v]);
        sum += dfs(v, u);
    }
    return sizes[u] = sum+1;
}

int ans(int v, int p){
    int rem = p;
    int u = v;
    for(int k = 19; k >= 0; k--){
        if(rem >= (1<<k)){
            if(u == -1) continue;
            u = dp[u][k];
            rem -= (1<<k);
        }
    }
    if(u == -1)
        return 0;

    int ans =  upper_bound(all(nodesAt[depth[v]]), mpp[u] + sizes[u]-1) - lower_bound(all(nodesAt[depth[v]]), mpp[u]) - 1;
    if(ans <= 0)
        return 0;
    return ans;
}

int main(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("in.txt", "rt", stdin);
	//	freopen("out.out", "wt", stdout);
#endif

    scanf("%d", &n);
    for(int i = 1; i <= n; i++){
        scanf("%d", &x);
        if(x == 0){
            roots.push_back(i);
            continue;
        }
        g[i].pb(x);
        g[x].pb(i);
    }

    memset(dp, -1, sizeof dp);

    for(int i = 0; i < roots.size(); i++){
        mpp[roots[i]] = ++cnt;
        dfs(roots[i], -1);
    }

    for(int k = 1; k <= 19; k++){
        for(int u = 1; u <= n; u++){
            if(dp[u][k-1] == -1) continue;
            dp[u][k] = dp[dp[u][k-1]][k-1];
        }
    }

    scanf("%d", &m);
    while(m--){
        scanf("%d%d", &v, &p);
        printf("%d ",ans(v, p));
    }

	return 0;
}


#include<iostream>
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define N 2*10e5
#define precise cout<<fixed<<setprecision(10)
#pragma GCC optimize("O0")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
using namespace std;
void get(ll arr[],ll n){for(ll i=0;i<n;i++) cin>>arr[i];}
int main()
{
 	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string x,y="\0";
	cin>>x;
	ll i=1;
	char c='v';
	if(x[0]!='a' && x[0]!='e' && x[0]!='i' && x[0]!='o' && x[0]!='u')
	c='c';
	ll count=0,same=0,k;
	y+=x[0];
	while(i<x.length())
	{
		if(c=='c' && x[i]==x[i-1])
		{
			k=0;
			if(count>=2)
			{
				y+=' ';
				y+=x[i];
				count=1;
				i++;
			}
			else{
			while( (i+k) <x.length()  && x[i+k]==x[i-1+k])
			{
				y+=x[i+k];
				k++;
			}
			if(i+k== x.length())
			break;
			else if(x[i+k]=='a' || x[i+k]=='e' || x[i+k]=='i' || x[i+k]=='o' || x[i+k]=='u')
			{
				i+=k;
				y+=x[i];
				i++;
				c='v';
				count=0;
			}
			else
			{
				    count=0;
					y+=' ';
					y+=x[i+k];
					count++;
					i+=k;
					i++;
			}}
		}
		else if(c=='c')
		{
			if(x[i]=='a' || x[i]=='e' || x[i]=='i' || x[i]=='o' || x[i]=='u')
			{
				count=0;
				y+=x[i];
				i++;
				c='v';
			}
			else
			{
					if(count>=2)
					{
						y+=' ';
						y+=x[i];
						i++;
						count=1;
					}
					else
					{
						count++;
						y+=x[i];
						i++;
					}
			}
		}
		else if(c=='v')
		{
			if(x[i]=='a' || x[i]=='e' || x[i]=='i' || x[i]=='o' || x[i]=='u')
			{
				y+=x[i];
				i++;
				count=0;
				same=0;
			}
			else
			{
				y+=x[i];
				count++;
				i++;
				c='c';
			}
		}
		//cout<<i;
	}
	cout<<y;
}


#include<iostream>
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define N 2*10e5
#define precise cout<<fixed<<setprecision(10)
#pragma GCC optimize("O0")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
using namespace std;
void get(ll arr[],ll n){for(ll i=0;i<n;i++) cin>>arr[i];}
int main()
{
 	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string x,y="\0";
	cin>>x;
	ll i=1;
	char c='v';
	ll count=0,same=0,k;
	if(x[0]!='a' && x[0]!='e' && x[0]!='i' && x[0]!='o' && x[0]!='u')
	c='c',count++;

	y+=x[0];
	while(i<x.length())
	{
		if(c=='c' && x[i]==x[i-1])
		{
			k=0;
			if(count>=2)
			{
				y+=' ';
				y+=x[i];
				count=1;
				i++;
			}
			else{
			while( (i+k) <x.length()  && x[i+k]==x[i-1+k])
			{
				y+=x[i+k];
				k++;
			}
			if(i+k== x.length())
			break;
			else if(x[i+k]=='a' || x[i+k]=='e' || x[i+k]=='i' || x[i+k]=='o' || x[i+k]=='u')
			{
				i+=k;
				y+=x[i];
				i++;
				c='v';
				count=0;
			}
			else
			{
				    count=0;
					y+=' ';
					y+=x[i+k];
					count++;
					i+=k;
					i++;
			}}
		}
		else if(c=='c')
		{
			if(x[i]=='a' || x[i]=='e' || x[i]=='i' || x[i]=='o' || x[i]=='u')
			{
				count=0;
				y+=x[i];
				i++;
				c='v';
			}
			else
			{
					if(count>=2)
					{
						y+=' ';
						y+=x[i];
						i++;
						count=1;
					}
					else
					{
						count++;
						y+=x[i];
						i++;
					}
			}
		}
		else if(c=='v')
		{
			if(x[i]=='a' || x[i]=='e' || x[i]=='i' || x[i]=='o' || x[i]=='u')
			{
				y+=x[i];
				i++;
				count=0;
				same=0;
			}
			else
			{
				y+=x[i];
				count++;
				i++;
				c='c';
			}
		}
		//cout<<i;
	}
	cout<<y;
}


#include<iostream>
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define N 2*10e5
#define precise cout<<fixed<<setprecision(10)
#pragma GCC optimize("O0")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
using namespace std;
void get(ll arr[],ll n){for(ll i=0;i<n;i++) cin>>arr[i];}
int main()
{
 	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string x,y="\0";
	cin>>x;
	ll i=1;
	char c='v';
	if(x[0]!='a' && x[0]!='e' && x[0]!='i' && x[0]!='o' && x[0]!='u')
	c='c';
	ll count=0,same=0,k;
	y+=x[0];
	while(i<x.length())
	{
		if(c=='c' && x[i]==x[i-1])
		{
			k=0;
			while(x[i+k]==x[i-1+k])
			{
				y+=x[i+k];
				k++;
			}
			if(x[i+k]=='a' || x[i+k]=='e' || x[i+k]=='i' || x[i+k]=='o' || x[i+k]=='u')
			{
				i+=k;
				y+=x[i];
				i++;
				c='v';
				count=0;
			}
			else
			{
				    count=0;
					y+=' ';
					y+=x[i+k];
					count++;
					i+=k;
					i++;
			}
		}
		else if(c=='c')
		{
			if(x[i]=='a' || x[i]=='e' || x[i]=='i' || x[i]=='o' || x[i]=='u')
			{
				count=0;
				y+=x[i];
				i++;
				c='v';
			}
			else
			{
					if(count>=2)
					{
						y+=' ';
						y+=x[i];
						i++;
						count=0;same=0;
					}
					else
					{
						count++;
						y+=x[i];
						i++;
					}
			}
		}
		else if(c=='v')
		{
			if(x[i]=='a' || x[i]=='e' || x[i]=='i' || x[i]=='o' || x[i]=='u')
			{
				y+=x[i];
				i++;
				count=0;
				same=0;
			}
			else
			{
				y+=x[i];
				count++;
				i++;
				c='c';
			}
		}
		//cout<<i;
	}
	cout<<y;
}


#include<iostream>
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define N 2*10e5
#define precise cout<<fixed<<setprecision(10)
#pragma GCC optimize("O0")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
using namespace std;
void get(ll arr[],ll n){for(ll i=0;i<n;i++) cin>>arr[i];}
int main()
{
 	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string x,y="\0";
	cin>>x;
	ll i=1;
	char c='v';
	if(x[0]!='a' && x[0]!='e' && x[0]!='i' && x[0]!='o' && x[0]!='u')
	c='c';
	ll count=0,same=0,k;
	y+=x[0];
	while(i<x.length())
	{
		if(c=='c' && x[i]==x[i-1])
		{
			k=0;
			if(count>=2)
			{
				y+=' ';
				y+=x[i];
				count=1;
				i++;
			}
			else{
			while( (i+k) <x.length()  && x[i+k]==x[i-1+k])
			{
				y+=x[i+k];
				k++;
			}
			if(i+k== x.length())
			break;
			else if(x[i+k]=='a' || x[i+k]=='e' || x[i+k]=='i' || x[i+k]=='o' || x[i+k]=='u')
			{
				i+=k;
				y+=x[i];
				i++;
				c='v';
				count=0;
			}
			else
			{
				    count=0;
					y+=' ';
					y+=x[i+k];
					count++;
					i+=k;
					i++;
			}}
		}
		else if(c=='c')
		{
			if(x[i]=='a' || x[i]=='e' || x[i]=='i' || x[i]=='o' || x[i]=='u')
			{
				count=0;
				y+=x[i];
				i++;
				c='v';
			}
			else
			{
					if(count>=2)
					{
						y+=' ';
						y+=x[i];
						i++;
						count=0;same=0;
					}
					else
					{
						count++;
						y+=x[i];
						i++;
					}
			}
		}
		else if(c=='v')
		{
			if(x[i]=='a' || x[i]=='e' || x[i]=='i' || x[i]=='o' || x[i]=='u')
			{
				y+=x[i];
				i++;
				count=0;
				same=0;
			}
			else
			{
				y+=x[i];
				count++;
				i++;
				c='c';
			}
		}
		//cout<<i;
	}
	cout<<y;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000

int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
    std::string s,ss="aeiou";
    std::cin>>s;
    for (int i=0;i<s.size();i++){
        if ((s[i] != s[i+1] || s[i+1] != s[i+2]) && ss.find(s[i])== -1 && ss.find(s[i+1]) == -1&&ss.find(s[i+2])==-1&&s[i]!='\0'&&s[i+1]!='\0')
            std::cout<<s[i]<<s[i+1]<<" ",i++;
        else if (s[i]!='\0')
            std::cout<<s[i];
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    string s; cin >> s;
    int dp[3001] = {0};
    if (s[0] == 'a' || s[0] == 'e' || s[0] == 'i' || s[0] == 'o' || s[0] == 'u') dp[0] = 0;
    else dp[0] = 1;
    for (int i(1); i < s.length(); ++i){
        if (!(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')){
            dp[i] = dp[i-1] + 1;
            if (dp[i] == 5) dp[i] = 3;
        } else dp[i] = 0;
    }
    for (int i(0); i < s.length(); ++i){
        if (dp[i] == 3){
            if (i-2 >= 0 && !(s[i] == s[i-1] && s[i-1] == s[i-2])){
                cout << " " << s[i];
            } else cout << s[i];
        } else cout << s[i];
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    string s; cin >> s;
    vector<int> dp(s.length());
    for (int i(0); i < s.length(); ++i){
        if (!(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')){
            dp[i] = dp[i-1] + 1;
            if (dp[i] == 5) dp[i] = 3;
        } else dp[i] = 0;
    }
    for (int i(0); i < s.length(); ++i){
        if (i < s.length() && dp[i] == 3){
            if (i-2 >= 0 && !(s[i] == s[i-1] && s[i-1] == s[i-2])){
                s.insert(i,(string)" ");
                dp.insert(dp.begin()+i,0);
                ++i;
            }
        }
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000

int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
    std::string s,ss="aeiou";
    std::cin>>s;
    for (int i=0;i<s.size();i++){
        if ((s[i] != s[i+1] || s[i+1] != s[i+2]) && ss.find(s[i])== -1 && ss.find(s[i+1]) == -1&&ss.find(s[i+2])==-1)
            std::cout<<s[i]<<s[i+1]<<" ",i++;
        else
            std::cout<<s[i];
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    string s; cin >> s;
    vector<int> dp(3000,0);
    for (int i(0); i < s.length(); ++i){
        if (!(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')){
            dp[i] = dp[i-1] + 1;
            if (dp[i] == 5) dp[i] = 3;
        } else dp[i] = 0;
    }
    for (int i(0); i < s.length(); ++i){
        if (dp[i] >= 3 && dp[i] == 3){
            if (!(i-2 >= 0 && s[i] == s[i-1] && s[i-1] == s[i-2])){
                s.insert(i,(string)" ");
                dp.insert(dp.begin()+i,0);
                ++i;
            }
        }
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    string s; cin >> s;
    vector<int> dp(s.length());
    for (int i(0); i < s.length(); ++i){
        if (!(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')){
            dp[i] = dp[i-1] + 1;
            if (dp[i] == 5) dp[i] = 3;
        } else dp[i] = 0;
    }
    for (int i(0); i < s.length(); ++i){
        if (dp[i] == 3){
            if (i-2 >= 0 && !(s[i] == s[i-1] && s[i-1] == s[i-2])){
                cout << " " << s[i];
            } else cout << s[i];
        } else cout << s[i];
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    string s; cin >> s;
    vector<int> dp(s.length());
    for (int i(0); i < s.length(); ++i){
        if (!(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')){
            dp[i] = dp[i-1] + 1;
            if (dp[i] == 5) dp[i] = 3;
        } else dp[i] = 0;
    }
    for (int i(0); i < s.length(); ++i){
        if (i < s.length() && dp[i] == 3){
            if (i-2 >= 0 && s[i] != s[i-1] && s[i-1] != s[i-2]){
                s.insert(i,(string)" ");
                dp.insert(dp.begin()+i,0);
                ++i;
            }
        }
    }
    cout << s << "\n";
    for (int i(0); i < dp.size(); ++i){
        cout << dp[i];
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    string s; cin >> s;
    vector<int> dp(s.length());
    for (int i(0); i < s.length(); ++i){
        if (!(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')){
            dp[i] = dp[i-1] + 1;
            if (dp[i] == 5) dp[i] = 3;
        } else dp[i] = 0;
    }
    for (int i(0); i < s.length(); ++i){
        if (i < s.length() && dp[i] >= 3 && dp[i] == 3){
            if (i-2 >= 0 && !(s[i] == s[i-1] && s[i-1] == s[i-2])){
                s.insert(i,(string)" ");
                if (i+2 < s.length())
                    dp.insert(dp.begin()+i,0);
                ++i;
            }
        }
    }
    cout << s;
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <set>
#include <map>
#include <iomanip>
#include <queue>
#include <vector>
#include <math.h>
#include <fstream>
#include <unordered_set>
#include <stack>
using namespace std;
vector<string> split(string str,string reg){
	vector<string>ans=vector<string>();
	for (int i=(int)str.find(reg);i!=string::npos;i=str.find(reg)){
		ans.push_back(str.substr(0,i));
		str=str.substr(i+reg.length());
	}
	ans.push_back(str);
	return ans;
}
template <class T>
int linear_search(T a[],T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
bool linear_search(vector<T> a,T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
int binary_search(vector<T>arr,T key){
	int l=-1,r=arr.size();
	while(l+1<r){
		int p=(l+r)/2;
		if (arr[p]>=key){r=p;}
		else {l=p;}
	}
	if (arr[r]==key){return r;}
	return -r-1;
}
int gcd(int a,int b){
	while (min(a,b)!=0){
		if (a<b){b%=a;}
		else {a%=b;}
	}
	return max(a,b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
int ctoi(char a){
	return a-48;
}
ifstream fin(""); //Name of file-input goes here
ofstream fout("");//Name of file-output goes here
//Write the code below this line
void run(){
	string s;cin>>s;
	set<char>v=set<char>();
	v.insert('a');
	v.insert( 'e');
	v.insert( 'i');
	v.insert('o' );
	v.insert('u');
	int q=0;
	char c=' ';
	queue<char>ss=queue<char>();
	for (char i:s){
		ss.push(i);
		if (ss.size()>3){
			ss.pop();
		}
		if (v.count(i)){
			q=0;
		} else {
			q++;
			if (q>=3){
				char j=ss.front();
				bool y=0;
				for (int i=0;i<3;i++){
					if (ss.front()!=j){y=1;break;}
					else {ss.push(ss.front());ss.pop();}
				}
				if (y){
					cout<<" ";
					q=0;
				}
			}
		}
		cout<<i;
		c=i;
	}
	cout<<endl;
}
// Write code above this line
int main() {run();return 0;}


#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <set>
#include <map>
#include <iomanip>
#include <queue>
#include <vector>
#include <math.h>
#include <fstream>
#include <unordered_set>
#include <stack>
using namespace std;
vector<string> split(string str,string reg){
	vector<string>ans=vector<string>();
	for (int i=(int)str.find(reg);i!=string::npos;i=str.find(reg)){
		ans.push_back(str.substr(0,i));
		str=str.substr(i+reg.length());
	}
	ans.push_back(str);
	return ans;
}
template <class T>
int linear_search(T a[],T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
bool linear_search(vector<T> a,T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
int binary_search(vector<T>arr,T key){
	int l=-1,r=arr.size();
	while(l+1<r){
		int p=(l+r)/2;
		if (arr[p]>=key){r=p;}
		else {l=p;}
	}
	if (arr[r]==key){return r;}
	return -r-1;
}
int gcd(int a,int b){
	while (min(a,b)!=0){
		if (a<b){b%=a;}
		else {a%=b;}
	}
	return max(a,b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
int ctoi(char a){
	return a-48;
}
ifstream fin(""); //Name of file-input goes here
ofstream fout("");//Name of file-output goes here
//Write the code below this line
void run(){
	string s;cin>>s;
	set<char>v=set<char>();
	v.insert('a');
	v.insert( 'e');
	v.insert( 'i');
	v.insert('o' );
	v.insert('u');
	int q=0;
	char c=' ';
	for (char i:s){
		if (v.count(i)){
			q=0;
		} else {
			if (i!=c){
				q++;
				if (q==3){
					cout<<" ";
					q=0;
				}
			}
		}
		cout<<i;
		c=i;
	}
	cout<<endl;
}
// Write code above this line
int main() {run();return 0;}


#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <set>
#include <map>
#include <iomanip>
#include <queue>
#include <vector>
#include <math.h>
#include <fstream>
#include <unordered_set>
#include <stack>
using namespace std;
vector<string> split(string str,string reg){
	vector<string>ans=vector<string>();
	for (int i=(int)str.find(reg);i!=string::npos;i=str.find(reg)){
		ans.push_back(str.substr(0,i));
		str=str.substr(i+reg.length());
	}
	ans.push_back(str);
	return ans;
}
template <class T>
int linear_search(T a[],T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
bool linear_search(vector<T> a,T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
int binary_search(vector<T>arr,T key){
	int l=-1,r=arr.size();
	while(l+1<r){
		int p=(l+r)/2;
		if (arr[p]>=key){r=p;}
		else {l=p;}
	}
	if (arr[r]==key){return r;}
	return -r-1;
}
int gcd(int a,int b){
	while (min(a,b)!=0){
		if (a<b){b%=a;}
		else {a%=b;}
	}
	return max(a,b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
int ctoi(char a){
	return a-48;
}
ifstream fin(""); //Name of file-input goes here
ofstream fout("");//Name of file-output goes here
//Write the code below this line
void run(){
	string s;cin>>s;
	set<char>v=set<char>();
	v.insert('a');
	v.insert( 'e');
	v.insert( 'i');
	v.insert('o' );
	v.insert('u');
	int q=0;
	for (char i:s){
		if (v.count(i)){
			q=0;
		} else {
			q++;
			if (q==3){
				cout<<" ";
			}
		}
		cout<<i;
	}
	cout<<endl;
}
// Write code above this line
int main() {run();return 0;}


#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <set>
#include <map>
#include <iomanip>
#include <queue>
#include <vector>
#include <math.h>
#include <fstream>
#include <unordered_set>
#include <stack>
// hfjff
using namespace std;
vector<string> split(string str,string reg){
	vector<string>ans=vector<string>();
	for (int i=(int)str.find(reg);i!=string::npos;i=str.find(reg)){
		ans.push_back(str.substr(0,i));
		str=str.substr(i+reg.length());
	}
	ans.push_back(str);
	return ans;
}
template <class T>
int linear_search(T a[],T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
bool linear_search(vector<T> a,T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
int binary_search(vector<T>arr,T key){
	int l=-1,r=arr.size();
	while(l+1<r){
		int p=(l+r)/2;
		if (arr[p]>=key){r=p;}
		else {l=p;}
	}
	if (arr[r]==key){return r;}
	return -r-1;
}
int gcd(int a,int b){
	while (min(a,b)!=0){
		if (a<b){b%=a;}
		else {a%=b;}
	}
	return max(a,b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
int ctoi(char a){
	return a-48;
}
ifstream fin(""); //Name of file-input goes here
ofstream fout("");//Name of file-output goes here
//Write the code below this line
void run(){
	string s;cin>>s;
	set<char>v=set<char>();
	v.insert('a');
	v.insert( 'e');
	v.insert( 'i');
	v.insert('o' );
	v.insert('u');
	int q=0;
	char c=' ';
	queue<char>ss=queue<char>();
	for (char i:s){
		ss.push(i);
		if (ss.size()>3){
			ss.pop();
		}
		if (v.count(i)){
			q=0;
			ss=queue<char>();
		} else {
			q++;
			if (q>=3){
				char j=ss.front();
				bool y=0;
				for (int i=0;i<3;i++){
					if (ss.front()!=j){y=1;}
					else {ss.push(ss.front());ss.pop();}
				}
				if (y){
					cout<<" ";
					q=1;
					ss=queue<char>();
					ss.push(i);
				}
			}
		}
		cout<<i;
		c=i;
	}
	cout<<endl;
}
// Write code above this line
int main() {run();return 0;}


#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <set>
#include <map>
#include <iomanip>
#include <queue>
#include <vector>
#include <math.h>
#include <fstream>
#include <unordered_set>
#include <stack>
using namespace std;
vector<string> split(string str,string reg){
	vector<string>ans=vector<string>();
	for (int i=(int)str.find(reg);i!=string::npos;i=str.find(reg)){
		ans.push_back(str.substr(0,i));
		str=str.substr(i+reg.length());
	}
	ans.push_back(str);
	return ans;
}
template <class T>
int linear_search(T a[],T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
bool linear_search(vector<T> a,T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
int binary_search(vector<T>arr,T key){
	int l=-1,r=arr.size();
	while(l+1<r){
		int p=(l+r)/2;
		if (arr[p]>=key){r=p;}
		else {l=p;}
	}
	if (arr[r]==key){return r;}
	return -r-1;
}
int gcd(int a,int b){
	while (min(a,b)!=0){
		if (a<b){b%=a;}
		else {a%=b;}
	}
	return max(a,b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
int ctoi(char a){
	return a-48;
}
ifstream fin(""); //Name of file-input goes here
ofstream fout("");//Name of file-output goes here
//Write the code below this line
void run(){
	string s;cin>>s;
	set<char>v=set<char>();
	v.insert('a');
	v.insert( 'e');
	v.insert( 'i');
	v.insert('o' );
	v.insert('u');
	int q=0;
	char c=' ';
	queue<char>ss=queue<char>();
	for (char i:s){
		ss.push(i);
		if (ss.size()>3){
			ss.pop();
		}
		if (v.count(i)){
			q=0;
			ss=queue<char>();
		} else {
			q++;
			if (q>=3){
				char j=ss.front();
				bool y=0;
				for (int i=0;i<3;i++){
					if (ss.front()!=j){y=1;}
					else {ss.push(ss.front());ss.pop();}
				}
				ss.push(ss.front());
				ss.pop();
				if (y){
					cout<<" ";
					q=1;
					ss.pop();
					ss.pop();
				}
			}
		}
		cout<<i;
		c=i;
	}
	cout<<endl;
}
// Write code above this line
int main() {run();return 0;}


#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <set>
#include <map>
#include <iomanip>
#include <queue>
#include <vector>
#include <math.h>
#include <fstream>
#include <unordered_set>
#include <stack>
using namespace std;
vector<string> split(string str,string reg){
	vector<string>ans=vector<string>();
	for (int i=(int)str.find(reg);i!=string::npos;i=str.find(reg)){
		ans.push_back(str.substr(0,i));
		str=str.substr(i+reg.length());
	}
	ans.push_back(str);
	return ans;
}
template <class T>
int linear_search(T a[],T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
bool linear_search(vector<T> a,T key){
	int ans=0;
	for (T i:a){
		ans++;
		if (i==key){return ans;}
	}
	return -1;
}
template <class T>
int binary_search(vector<T>arr,T key){
	int l=-1,r=arr.size();
	while(l+1<r){
		int p=(l+r)/2;
		if (arr[p]>=key){r=p;}
		else {l=p;}
	}
	if (arr[r]==key){return r;}
	return -r-1;
}
int gcd(int a,int b){
	while (min(a,b)!=0){
		if (a<b){b%=a;}
		else {a%=b;}
	}
	return max(a,b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
int ctoi(char a){
	return a-48;
}
ifstream fin(""); //Name of file-input goes here
ofstream fout("");//Name of file-output goes here
//Write the code below this line
void run(){
	string s;cin>>s;
	set<char>v=set<char>();
	v.insert('a');
	v.insert( 'e');
	v.insert( 'i');
	v.insert('o' );
	v.insert('u');
	int q=0;
	char c=' ';
	queue<char>ss=queue<char>();
	for (char i:s){
		ss.push(i);
		if (ss.size()>3){
			ss.pop();
		}
		if (v.count(i)){
			q=0;
		} else {
			q++;
			if (q>=3){
				char j=ss.front();
				bool y=0;
				for (int i=0;i<3;i++){
					if (ss.front()!=j){y=1;}
					else {ss.push(ss.front());ss.pop();}
				}
				ss.push(ss.front());
				ss.pop();
				if (y){
					cout<<" ";
					q=1;
					ss.pop();
					ss.pop();
				}
			}
		}
		cout<<i;
		c=i;
	}
	cout<<endl;
}
// Write code above this line
int main() {run();return 0;}


#include <bits/stdc++.h>

using namespace std;

string s;
int n;
set<char> v;
int cnt;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    for (int i=0; i<s.size(); i++)
    {
        char c = s[i];
        if (s[i]!='a' && s[i]!='e' && s[i]!='o' && s[i]!='u' && s[i]!='i')
        {
            cnt++;
            auto k = v.find(s[i]);
            if (k==v.end())
            {
                v.insert(s[i]);
            }
            if (cnt>=3)
            {
                if (v.size()==1)
                {
                    cnt = 1;
                }
                else
                {
                    s.insert(i, " ");
                    cnt = 1;
                }
                while (v.size()) v.clear();
                v.insert(c);
            }
        }
        else cnt = 0;
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s;
int n;
set<char> v;
int cnt;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    for (int i=0; i<s.size(); i++)
    {
        char c = s[i];
        if (s[i]!='a' && s[i]!='e' && s[i]!='o' && s[i]!='u' && s[i]!='i')
        {
            cnt++;
            auto k = v.find(s[i]);
            if (k==v.end())
            {
                v.insert(s[i]);
            }
            if (cnt>=3)
            {
                if (v.size()==1)
                {
                    cnt = 2;
                }
                else
                {
                    s.insert(i, " ");
                    cnt = 0;
                }
                if (v.size()) v.clear();
                v.insert(c);
            }
        }
        else
        {
            cnt = 0;
            if (v.size()) v.clear();
        }
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s;
int n;
set<char> v;
int cnt;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    for (int i=0; i<s.size(); i++)
    {
        char c = s[i];
        if (s[i]!='a' && s[i]!='e' && s[i]!='o' && s[i]!='u' && s[i]!='i')
        {
            cnt++;
            auto k = v.find(s[i]);
            if (k==v.end())
            {
                v.insert(s[i]);
            }
            if (cnt>=3)
            {
                if (v.size()==1)
                {
                    cnt = 0;
                }
                else
                {
                    s.insert(i, " ");
                    cnt = 0;
                }
                if (v.size()) v.clear();
            }
        }
        else cnt = 0;
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s;
int n;
set<char> v;
int cnt;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    for (int i=0; i<s.size(); i++)
    {
        char c = s[i];
        if (s[i]!='a' && s[i]!='e' && s[i]!='o' && s[i]!='u' && s[i]!='i')
        {
            cnt++;
            auto k = v.find(s[i]);
            if (k==v.end())
            {
                v.insert(s[i]);
            }
            if (cnt>=3)
            {
                if (v.size()==1)
                {
                    cnt = 0;
                }
                else
                {
                    s.insert(i, " ");
                    cnt = 0;
                }
                while (v.size()) v.clear();
                v.insert(c);
            }
        }
        else cnt = 0;
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s;
int n;
set<char> v;
int cnt;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    for (int i=0; i<s.size(); i++)
    {
        char c = s[i];
        if (s[i]!='a' && s[i]!='e' && s[i]!='o' && s[i]!='u' && s[i]!='i')
        {
            cnt++;
            auto k = v.find(s[i]);
            if (k==v.end())
            {
                v.insert(s[i]);
            }
            if (cnt>=3)
            {
                if (v.size()==1)
                {
                    cnt = 0;
                }
                else
                {
                    s.insert(i, " ");
                    cnt = 0;
                }
                if (v.size()) v.clear();
            }
        }
        else
        {
            cnt = 0;
            if (v.size()) v.clear();
        }
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s;
int n;
set<char> v;
int cnt;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    for (int i=0; i<s.size(); i++)
    {
        char c = s[i];
        if (s[i]!='a' && s[i]!='e' && s[i]!='o' && s[i]!='u' && s[i]!='i')
        {
            cnt++;
            auto k = v.find(s[i]);
            if (k==v.end())
            {
                v.insert(s[i]);
            }
            if (cnt>=3)
            {
                if (v.size()==1)
                {
                    cnt = 1;
                }
                else
                {
                    s.insert(i, " ");
                    cnt = 0;
                }
                if (v.size()) v.clear();
                v.insert(c);
            }
        }
        else
        {
            cnt = 0;
            if (v.size()) v.clear();
        }
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s;
int n;
set<char> v;
int cnt;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    for (int i=0; i<s.size(); i++)
    {
        char c = s[i];
        if (s[i]!='a' && s[i]!='e' && s[i]!='o' && s[i]!='u' && s[i]!='i')
        {
            cnt++;
            auto k = v.find(s[i]);
            if (k==v.end())
            {
                v.insert(s[i]);
            }
            if (cnt>=3)
            {
                if (v.size()==1)
                {
                    cnt = 0;
                }
                else
                {
                    s.insert(i, " ");
                    cnt = 0;
                }
                if (v.size()) v.clear();
                v.insert(c);
            }
        }
        else
        {
            cnt = 0;
            if (v.size()) v.clear();
        }
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s;
int n;
set<char> v;
int cnt;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    for (int i=0; i<s.size(); i++)
    {
        if (s[i]!='a' && s[i]!='e' && s[i]!='o' && s[i]!='u' && s[i]!='i')
        {
            cnt++;
            auto k = v.find(s[i]);
            if (k==v.end())
            {
                v.insert(s[i]);
            }
            if (cnt>=3)
            {
                if (v.size()==1)
                {
                    cnt = 0;
                }
                else
                {
                    s.insert(i, " ");
                    cnt = 0;
                }
                if (v.size()) v.clear();
            }
        }
        else
        {
            cnt = 0;
            if (v.size()) v.clear();
        }
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
//int dx[]={-1,-1,-1,0,1,1,1,0};//king's move
//int dy[]={-1,0,1,1,1,0,-1,-1};//king's move
int dx[]={-1,1,0,0,0,0,0,0};
int dy[]={0,0,1,-1,0,0,0,0};
//int dz[]={0,0,0,0,1,-1,0,0};
//int dt[]={0,0,0,0,0,0,-1,1};
//int dx1[]={1,-1,1,-1,2,2,-2,-2};//knight's move
//int dy1[]={2,2,-2,-2,1,-1,1,-1};//knight's move
const int inf=1000000007;
const double eps=0.000000009;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    if(s.length()<3)
    {
    	cout<<s<<endl;
    	return 0;
	}
    set<char> v;
    v.insert('a');
    v.insert('e');
    v.insert('i');
    v.insert('o');
    v.insert('u');
    int str=0;
    cout<<s[0]<<s[1];
    char pr1=s[1],pr2=s[0];
    for(int i=2;i<s.length();i++)
    {
    	if(v.find(s[i])==v.end())
    	{
    		if(v.find(pr1)==v.end()&&v.find(pr2)==v.end())
    		{
    			if(pr1==pr2&&pr1==s[i])
    			{
    				cout<<s[i];
    				continue;
				}
				else
				{
					cout<<" "<<s[i];
					pr1='0';
					pr2=='1';
				}
				continue;
			}
			cout<<s[i];
			pr2=pr1;
			pr1=s[i];
		}
		else
		{
			cout<<s[i];
			pr1='0';
			pr2=='1';
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
//int dx[]={-1,-1,-1,0,1,1,1,0};//king's move
//int dy[]={-1,0,1,1,1,0,-1,-1};//king's move
int dx[]={-1,1,0,0,0,0,0,0};
int dy[]={0,0,1,-1,0,0,0,0};
//int dz[]={0,0,0,0,1,-1,0,0};
//int dt[]={0,0,0,0,0,0,-1,1};
//int dx1[]={1,-1,1,-1,2,2,-2,-2};//knight's move
//int dy1[]={2,2,-2,-2,1,-1,1,-1};//knight's move
const int inf=1000000007;
const double eps=0.000000009;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    if(s.length()<3)
    {
    	cout<<s<<endl;
    	return 0;
	}
    set<char> v;
    v.insert('a');
    v.insert('e');
    v.insert('i');
    v.insert('o');
    v.insert('u');
    int str=0;
    cout<<s[0]<<s[1];
    char pr1=s[1],pr2=s[0];
    for(int i=2;i<s.length();i++)
    {
    	if(v.find(s[i])==v.end())
    	{
    		if(v.find(pr1)==v.end()&&v.find(pr2)==v.end())
    		{
    			if(pr1==pr2&&pr1==s[i])
    			{
    				cout<<s[i];
    				continue;
				}
				else
				{
					cout<<" "<<s[i];
					pr1='0';
					pr2=='1';
				}
				continue;
			}
			cout<<s[i];
			pr2=pr1;
			pr1=s[i];
		}
		else
		{
			cout<<s[i];
			pr1='a';
			pr2=='e';
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
//int dx[]={-1,-1,-1,0,1,1,1,0};//king's move
//int dy[]={-1,0,1,1,1,0,-1,-1};//king's move
int dx[]={-1,1,0,0,0,0,0,0};
int dy[]={0,0,1,-1,0,0,0,0};
//int dz[]={0,0,0,0,1,-1,0,0};
//int dt[]={0,0,0,0,0,0,-1,1};
//int dx1[]={1,-1,1,-1,2,2,-2,-2};//knight's move
//int dy1[]={2,2,-2,-2,1,-1,1,-1};//knight's move
const int inf=1000000007;
const double eps=0.000000009;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    if(s.length()<3)
    {
    	cout<<s<<endl;
    	return 0;
	}
    set<char> v;
    v.insert('a');
    v.insert('e');
    v.insert('i');
    v.insert('o');
    v.insert('u');
    int str=0;
    cout<<s[0]<<s[1];
    char pr1=s[1],pr2=s[0];
    for(int i=2;i<s.length();i++)
    {
    	if(v.find(s[i])==v.end())
    	{
    		if(v.find(pr1)==v.end()&&v.find(pr2)==v.end())
    		{
    			if(pr1==pr2&&pr1==s[i])
    			{
    				cout<<s[i];
    				continue;
				}
				else
				{
					cout<<" "<<s[i];
					pr1=s[i];
					pr2='e';
				}
				continue;
			}
			cout<<s[i];
			pr2=pr1;
			pr1=s[i];
		}
		else
		{
			cout<<s[i];
			pr1=s[i];
			pr2='e';
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
//int dx[]={-1,-1,-1,0,1,1,1,0};//king's move
//int dy[]={-1,0,1,1,1,0,-1,-1};//king's move
int dx[]={-1,1,0,0,0,0,0,0};
int dy[]={0,0,1,-1,0,0,0,0};
//int dz[]={0,0,0,0,1,-1,0,0};
//int dt[]={0,0,0,0,0,0,-1,1};
//int dx1[]={1,-1,1,-1,2,2,-2,-2};//knight's move
//int dy1[]={2,2,-2,-2,1,-1,1,-1};//knight's move
const int inf=1000000007;
const double eps=0.000000009;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    set<char> v;
    v.insert('a');
    v.insert('e');
    v.insert('i');
    v.insert('o');
    v.insert('u');
    int str=0;
    char prev=s[0];
    cout<<s[0];
    if(v.find(s[0])==v.end())
    str++;
    int same=0;
    for(int i=1;i<s.length();i++)
    {
    	if(v.find(s[i])==v.end())
    	{
    		str++;
    		if(str==3)
    		{
    			if(same&&s[i]==prev)
    			{
    				str=2;
    				cout<<s[i];
    				continue;
				}
				else
				{
					cout<<" "<<s[i];
					str=1;
					same=0;
					prev=s[i];
				}
				continue;
			}
			else if(str==2)
			{
				if(s[i]==prev)
				{
					same=1;
				}
				else
				{
					same=0;
				}
			}
			cout<<s[i];
		}
		else
		{
			prev=s[i];
			cout<<s[i];
			str=0;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
//int dx[]={-1,-1,-1,0,1,1,1,0};//king's move
//int dy[]={-1,0,1,1,1,0,-1,-1};//king's move
int dx[]={-1,1,0,0,0,0,0,0};
int dy[]={0,0,1,-1,0,0,0,0};
//int dz[]={0,0,0,0,1,-1,0,0};
//int dt[]={0,0,0,0,0,0,-1,1};
//int dx1[]={1,-1,1,-1,2,2,-2,-2};//knight's move
//int dy1[]={2,2,-2,-2,1,-1,1,-1};//knight's move
const int inf=1000000007;
const double eps=0.000000009;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    if(s.length()<3)
    {
    	cout<<s<<endl;
    	return 0;
	}
    set<char> v;
    v.insert('a');
    v.insert('e');
    v.insert('i');
    v.insert('o');
    v.insert('u');
    int str=0;
    cout<<s[0]<<s[1];
    char pr1=s[1],pr2=s[0];
    for(int i=2;i<s.length();i++)
    {
    	if(v.find(s[i])==v.end())
    	{
    		if(v.find(pr1)==v.end()&&v.find(pr2)==v.end())
    		{
    			if(pr1==pr2&&pr1==s[i])
    			{
    				cout<<s[i];
    				continue;
				}
				else
				{
					cout<<" "<<s[i];
					pr1='a';
					pr2=='e';
				}
				continue;
			}
			cout<<s[i];
			pr2=pr1;
			pr1=s[i];
		}
		else
		{
			cout<<s[i];
			pr1='a';
			pr2=='e';
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
//int dx[]={-1,-1,-1,0,1,1,1,0};//king's move
//int dy[]={-1,0,1,1,1,0,-1,-1};//king's move
int dx[]={-1,1,0,0,0,0,0,0};
int dy[]={0,0,1,-1,0,0,0,0};
//int dz[]={0,0,0,0,1,-1,0,0};
//int dt[]={0,0,0,0,0,0,-1,1};
//int dx1[]={1,-1,1,-1,2,2,-2,-2};//knight's move
//int dy1[]={2,2,-2,-2,1,-1,1,-1};//knight's move
const int inf=1000000007;
const double eps=0.000000009;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    set<char> v;
    v.insert('a');
    v.insert('e');
    v.insert('i');
    v.insert('o');
    v.insert('u');
    int str=0;
    char prev=s[0];
    cout<<s[0];
    if(v.find(s[0])==v.end())
    str++;
    int same=0;
    for(int i=1;i<s.length();i++)
    {
    	if(v.find(s[i])==v.end())
    	{
    		str++;
    		if(str==3)
    		{
    			if(same&&s[i]==prev)
    			{
    				str=2;
    				cout<<s[i];
    				continue;
				}
				else
				{
					cout<<" "<<s[i];
					str=1;
					prev=s[i];
				}
				continue;
			}
			else if(str==2)
			{
				if(s[i]==prev)
				{
					same=1;
				}
				else
				{
					same=0;
				}
			}
			cout<<s[i];
		}
		else
		{
			prev=s[i];
			cout<<s[i];
			str=0;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int32_t main(){
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  string s;
  cin>>s;
  ll n;
  n=s.length();
  ll dp[n+1];
  set<char> s1;
  s1.insert('a');
  s1.insert('e');
  s1.insert('i');
  s1.insert('o');
  s1.insert('u');
  set<char> p;
  for(int i=0;i<=n;i++)dp[i]=0;
  ll count=0;
  for(int i=0;i<n;i++){

      if(s1.count(s[i])==0){
            p.insert(s[i]);
            if(p.size()>=2||(p.size()==1&&(dp[i]==0||dp[i]==1))){
              dp[i+1]=dp[i]+1;
              count++;
              if(dp[i+1]!=3)cout<<s[i];
            }
            if(dp[i+1]==3){
                p.clear();
                cout<<" "<<s[i];
                p.insert(s[i]);
                dp[i+1]=1;
                //i++;
            }
      }
      else{
          cout<<s[i];
      }
  }
//   for(int i=0;i<n;i++){
//       if(dp[i+1]==3){
//           cout<<s[i]<<" ";
//       }
//       else{
//           cout<<s[i];
//       }
//   }
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int32_t main(){
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  string s;
  cin>>s;
  ll n;
  n=s.length();
  ll dp[n+1];
  set<char> s1;
  s1.insert('a');
  s1.insert('e');
  s1.insert('i');
  s1.insert('o');
  s1.insert('u');
  set<char> p;
  for(int i=0;i<=n;i++)dp[i]=0;
  ll count=0;
  for(int i=0;i<n;i++){

      if(s1.count(s[i])==0){
            p.insert(s[i]);
            if(p.size()>=2||(p.size()==1&&(dp[i]==0||dp[i]==1))){
              dp[i+1]=dp[i]+1;
              if(dp[i+1]!=3)cout<<s[i];
                if(dp[i+1]==3){
                p.clear();
                cout<<" "<<s[i];
                p.insert(s[i]);
                dp[i+1]=1;
                //i++;
            }
            }
            else {
                cout<<s[i];
                p.clear();
            }

      }
      else{
          cout<<s[i];
          p.clear();
      }
  }
//   for(int i=0;i<n;i++){
//       if(dp[i+1]==3){
//           cout<<s[i]<<" ";
//       }
//       else{
//           cout<<s[i];
//       }
//   }
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define N 200001
#define pi pair<int , int>
#define mp make_pair
#define ll long long
#define f first
#define s second
bool isvowel(char c){
     if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
          return true;
     }
     return false;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string str;
cin>>str;
int n= str.length();
int cntc= 1;
int cntf = 0;
string output = "";
for(int i = 0 ; i < n-1 ; i++){
     output+= str[i];
      if(str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] == 'u'){
           cntc = 1;
           cntf = 0;
           continue;
      }
      cntf++;
      if(str[i+1] != str[i] && !isvowel(str[i+1])){
            cntc++;
            //cntf++;
      }

         cntf++;

           if(cntc > 1 && cntf >= 3 && !isvowel(str[i+1])){
            output+=" ";
            cntc = 1;
            cntf = 0;
      }

}
output+= str[n-1];
cout<<output<<endl;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int32_t main(){
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  string s;
  cin>>s;
  ll n;
  n=s.length();
  ll dp[n+1];
  set<char> s1;
  s1.insert('a');
  s1.insert('e');
  s1.insert('i');
  s1.insert('o');
  s1.insert('u');
  set<char> p;
  for(int i=0;i<=n;i++)dp[i]=0;
  for(int i=0;i<n;i++){

      if(s1.count(s[i])==0){
            p.insert(s[i]);
            if(p.size()>=2||(p.size()==1&&(dp[i]==0||dp[i]==1))){
              dp[i+1]=dp[i]+1;

            }
            if(dp[i+1]==3){
                p.clear();
            }
      }
  }
  for(int i=0;i<n;i++){
      if(dp[i+2]==3&&i+2<=n){
          cout<<s[i]<<" ";
      }
      else{
          cout<<s[i];
      }
  }
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int32_t main(){
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  string s;
  cin>>s;
  ll n;
  n=s.length();
  ll dp[n+1];
  set<char> s1;
  s1.insert('a');
  s1.insert('e');
  s1.insert('i');
  s1.insert('o');
  s1.insert('u');
  set<char> p;
  for(int i=0;i<=n;i++)dp[i]=0;
  ll count=0;
  for(int i=0;i<n;i++){

      if(s1.count(s[i])==0){
            p.insert(s[i]);
            if(p.size()>=2||(p.size()==1&&(dp[i]==0||dp[i]==1))){
              dp[i+1]=dp[i]+1;
              count++;
              if(dp[i+1]!=3)cout<<s[i];
                if(dp[i+1]==3){
                p.clear();
                cout<<" "<<s[i];
                p.insert(s[i]);
                dp[i+1]=1;
                //i++;
            }
            }
            else cout<<s[i];

      }
      else{
          cout<<s[i];
      }
  }
//   for(int i=0;i<n;i++){
//       if(dp[i+1]==3){
//           cout<<s[i]<<" ";
//       }
//       else{
//           cout<<s[i];
//       }
//   }
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int32_t main(){
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  string s;
  cin>>s;
  ll n;
  n=s.length();
  ll dp[n+1];
  set<char> s1;
  s1.insert('a');
  s1.insert('e');
  s1.insert('i');
  s1.insert('o');
  s1.insert('u');
  set<char> p;
  for(int i=0;i<=n;i++)dp[i]=0;
  ll count=0;
  for(int i=0;i<n;i++){

      if(s1.count(s[i])==0){
            p.insert(s[i]);
            if(p.size()>=2||(p.size()==1&&(dp[i]==0||dp[i]==1))){
              dp[i+1]=count+1;
              count++;
            }
            if(dp[i+1]==3){
                p.clear();
                count=0;
            }
      }
  }
  for(int i=0;i<n;i++){
      if(dp[i+2]==3&&i+2<=n){
          cout<<s[i]<<" ";
      }
      else{
          cout<<s[i];
      }
  }
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int32_t main(){
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  string s;
  cin>>s;
  ll n;
  n=s.length();
  ll dp[n+1];
  set<char> s1;
  s1.insert('a');
  s1.insert('e');
  s1.insert('i');
  s1.insert('o');
  s1.insert('u');
  set<char> p;
  for(int i=0;i<=n;i++)dp[i]=0;
  for(int i=0;i<n;i++){

      if(s1.count(s[i])==0){
            p.insert(s[i]);
            if(p.size()>=2||(p.size()==1&&(dp[i]==0||dp[i]==1))){
              dp[i+1]=dp[i]+1;

            }
            if(dp[i+1]==3){
                p.clear();
            }
      }
  }
  for(int i=0;i<n;i++){
      if(dp[i+2]==3){
          cout<<s[i]<<" ";
      }
      else{
          cout<<s[i];
      }
  }
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int32_t main(){
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  string s;
  cin>>s;
  ll n;
  n=s.length();
  ll dp[n+1];
  set<char> s1;
  s1.insert('a');
  s1.insert('e');
  s1.insert('i');
  s1.insert('o');
  s1.insert('u');
  set<char> p;
  for(int i=0;i<=n;i++)dp[i]=0;
  ll count=0;
  for(int i=0;i<n;i++){

      if(s1.count(s[i])==0){
            p.insert(s[i]);
            if(p.size()>=2||(p.size()==1&&(dp[i]==0||dp[i]==1))){
              dp[i+1]=dp[i]+1;
              if(dp[i+1]!=3)cout<<s[i];
                if(dp[i+1]==3){
                p.clear();
                cout<<" "<<s[i];
                p.insert(s[i]);
                dp[i+1]=1;
                //i++;
            }
            }
            else {
                cout<<s[i];
                //p.clear();
            }

      }
      else{
          cout<<s[i];
          p.clear();
      }
  }
//   for(int i=0;i<n;i++){
//       if(dp[i+1]==3){
//           cout<<s[i]<<" ";
//       }
//       else{
//           cout<<s[i];
//       }
//   }
}


#include <bits/stdc++.h>
using namespace std;

template<typename XTYPE> inline void _var_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VARIABLE = " << a << endl;
    #endif
}
template<typename XTYPE> inline void _vector_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VECTOR" << endl; for(auto it = a.begin(); it != a.end(); it++) { cout << *it << " "; } cout << endl << endl;
    #endif
}
template<typename XTYPE> inline void _matrix_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG MATRIX" << endl; for(auto i = a.begin(); i != a.end(); i++) { for(auto j = (*i).begin(); j != (*i).end(); j++) { cout << *j << " "; } cout << endl; } cout << endl << endl;
    #endif
}

//STREAM ACCELERATION - delete 'endl' define and 'tie' in interactive problemes
inline void fast_input(){
    ios_base::sync_with_stdio(false);
}

//FAST CODING HEADER------------------------------------------------
#define forn(i, n)                   for(int i = 0; i < int(n); i++)
#define fori(i, n)                   for(int i = 1; i < int(n); i++)
#define ford(i, n)                   for(int i = int(n) - 1; i >= 0; i--)
#define pb(a)                        push_back(a)
#define all(a)                       a.begin(), a.end()
#define mysort(a, cmp_f)             sort(a.begin(), a.end(), cmp_f)
#define upsort(a)                    sort(a.begin(), a.end())
#define mp(a, b)                     make_pair(a, b)
#define rsz                          resize
#define rsrv                         reserve
#define lwbnd(a, elem)               lower_bound(a.begin(), a.end(), elem)
#define upbnd(a, elem)               upper_bound(a.begin(), a.end(), elem)
#define ins(a)                       insert(a)
#define sz                           size()

typedef long long ll;
typedef long double ld;

typedef string str;

typedef vector<int> vint;
typedef vector<bool> vbool;
typedef vector<long long> vll;
typedef vector<string> vstr;

typedef pair <int,int> pii;
typedef pair <long long,long long> pll;

typedef vector< vector<int> > mint;
typedef vector< vector<bool> > mbool;
typedef vector< vector<long long> > mll;

const ll LINF = LLONG_MAX;
const int INF = 2000000000;
const double PI = atan(1.0)*4;
const int MOD = 1e9+7;

//------------------------PROBLEM SOLVE---------------------------------
str s;

bool isgl(char c){
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
        return 1;
    }
    return 0;
}

int main(){
    #ifdef _DEBUG_
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast_input();

    cin >> s;

    str sub = "";

    forn(i, s.sz){
        if(isgl(s[i])){
            sub += s[i];
            continue;
        }

        if(i >=2 && !isgl(s[i]) && !isgl(s[i-1]) && !isgl(s[i-2]) && !(s[i] == s[i-1] && s[i-1] == s[i-2])){
            cout << sub << " ";
            s[i-1] = 'a';
            s[i-2] = 'a';

            sub = s[i];
        }else{
            sub += s[i];
        }
    }
    cout << sub;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

template<typename XTYPE> inline void _var_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VARIABLE = " << a << endl;
    #endif
}
template<typename XTYPE> inline void _vector_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VECTOR" << endl; for(auto it = a.begin(); it != a.end(); it++) { cout << *it << " "; } cout << endl << endl;
    #endif
}
template<typename XTYPE> inline void _matrix_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG MATRIX" << endl; for(auto i = a.begin(); i != a.end(); i++) { for(auto j = (*i).begin(); j != (*i).end(); j++) { cout << *j << " "; } cout << endl; } cout << endl << endl;
    #endif
}

//STREAM ACCELERATION - delete 'endl' define and 'tie' in interactive problemes
inline void fast_input(){
    ios_base::sync_with_stdio(false);
}

//FAST CODING HEADER------------------------------------------------
#define forn(i, n)                   for(int i = 0; i < int(n); i++)
#define fori(i, n)                   for(int i = 1; i < int(n); i++)
#define ford(i, n)                   for(int i = int(n) - 1; i >= 0; i--)
#define pb(a)                        push_back(a)
#define all(a)                       a.begin(), a.end()
#define mysort(a, cmp_f)             sort(a.begin(), a.end(), cmp_f)
#define upsort(a)                    sort(a.begin(), a.end())
#define mp(a, b)                     make_pair(a, b)
#define rsz                          resize
#define rsrv                         reserve
#define lwbnd(a, elem)               lower_bound(a.begin(), a.end(), elem)
#define upbnd(a, elem)               upper_bound(a.begin(), a.end(), elem)
#define ins(a)                       insert(a)
#define sz                           size()

typedef long long ll;
typedef long double ld;

typedef string str;

typedef vector<int> vint;
typedef vector<bool> vbool;
typedef vector<long long> vll;
typedef vector<string> vstr;

typedef pair <int,int> pii;
typedef pair <long long,long long> pll;

typedef vector< vector<int> > mint;
typedef vector< vector<bool> > mbool;
typedef vector< vector<long long> > mll;

const ll LINF = LLONG_MAX;
const int INF = 2000000000;
const double PI = atan(1.0)*4;
const int MOD = 1e9+7;

//------------------------PROBLEM SOLVE---------------------------------
str s;

bool isgl(char c){
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
        return 1;
    }
    return 0;
}

int main(){
    #ifdef _DEBUG_
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast_input();

    cin >> s;

    str sub = "";
    int cnt = 0;

    forn(i, s.sz){
        if(isgl(s[i])){
            sub += s[i];
            cnt = 0;
            continue;
        }

        cnt++;
        if(cnt >= 3 && !(s[i] == s[i-1] && s[i-1] == s[i-2])){
            cout << sub << " ";
            sub = s[i];
        }else{
            sub += s[i];
        }
    }
    cout << sub;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

template<typename XTYPE> inline void _var_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VARIABLE = " << a << endl;
    #endif
}
template<typename XTYPE> inline void _vector_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VECTOR" << endl; for(auto it = a.begin(); it != a.end(); it++) { cout << *it << " "; } cout << endl << endl;
    #endif
}
template<typename XTYPE> inline void _matrix_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG MATRIX" << endl; for(auto i = a.begin(); i != a.end(); i++) { for(auto j = (*i).begin(); j != (*i).end(); j++) { cout << *j << " "; } cout << endl; } cout << endl << endl;
    #endif
}

//STREAM ACCELERATION - delete 'endl' define and 'tie' in interactive problemes
inline void fast_input(){
    ios_base::sync_with_stdio(false);
}

//FAST CODING HEADER------------------------------------------------
#define forn(i, n)                   for(int i = 0; i < int(n); i++)
#define fori(i, n)                   for(int i = 1; i < int(n); i++)
#define ford(i, n)                   for(int i = int(n) - 1; i >= 0; i--)
#define pb(a)                        push_back(a)
#define all(a)                       a.begin(), a.end()
#define mysort(a, cmp_f)             sort(a.begin(), a.end(), cmp_f)
#define upsort(a)                    sort(a.begin(), a.end())
#define mp(a, b)                     make_pair(a, b)
#define rsz                          resize
#define rsrv                         reserve
#define lwbnd(a, elem)               lower_bound(a.begin(), a.end(), elem)
#define upbnd(a, elem)               upper_bound(a.begin(), a.end(), elem)
#define ins(a)                       insert(a)
#define sz                           size()

typedef long long ll;
typedef long double ld;

typedef string str;

typedef vector<int> vint;
typedef vector<bool> vbool;
typedef vector<long long> vll;
typedef vector<string> vstr;

typedef pair <int,int> pii;
typedef pair <long long,long long> pll;

typedef vector< vector<int> > mint;
typedef vector< vector<bool> > mbool;
typedef vector< vector<long long> > mll;

const ll LINF = LLONG_MAX;
const int INF = 2000000000;
const double PI = atan(1.0)*4;
const int MOD = 1e9+7;

//------------------------PROBLEM SOLVE---------------------------------
str s;

bool isgl(char c){
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
        return 1;
    }
    return 0;
}

int main(){
    #ifdef _DEBUG_
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast_input();

    cin >> s;

    str sub = "";

    forn(i, s.sz){
        if(isgl(s[i])){
            sub += s[i];
            continue;
        }

        if(i >=2 && !isgl(s[i]) && !isgl(s[i-1]) && !isgl(s[i-2]) && !(s[i] == s[i-1] && s[i-1] == s[i-2])){
            cout << sub << " ";
            sub = s[i];
        }else{
            sub += s[i];
        }
    }
    cout << sub;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

template<typename XTYPE> inline void _var_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VARIABLE = " << a << endl;
    #endif
}
template<typename XTYPE> inline void _vector_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VECTOR" << endl; for(auto it = a.begin(); it != a.end(); it++) { cout << *it << " "; } cout << endl << endl;
    #endif
}
template<typename XTYPE> inline void _matrix_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG MATRIX" << endl; for(auto i = a.begin(); i != a.end(); i++) { for(auto j = (*i).begin(); j != (*i).end(); j++) { cout << *j << " "; } cout << endl; } cout << endl << endl;
    #endif
}

//STREAM ACCELERATION - delete 'endl' define and 'tie' in interactive problemes
inline void fast_input(){
    ios_base::sync_with_stdio(false);
}

//FAST CODING HEADER------------------------------------------------
#define forn(i, n)                   for(int i = 0; i < int(n); i++)
#define fori(i, n)                   for(int i = 1; i < int(n); i++)
#define ford(i, n)                   for(int i = int(n) - 1; i >= 0; i--)
#define pb(a)                        push_back(a)
#define all(a)                       a.begin(), a.end()
#define mysort(a, cmp_f)             sort(a.begin(), a.end(), cmp_f)
#define upsort(a)                    sort(a.begin(), a.end())
#define mp(a, b)                     make_pair(a, b)
#define rsz                          resize
#define rsrv                         reserve
#define lwbnd(a, elem)               lower_bound(a.begin(), a.end(), elem)
#define upbnd(a, elem)               upper_bound(a.begin(), a.end(), elem)
#define ins(a)                       insert(a)
#define sz                           size()

typedef long long ll;
typedef long double ld;

typedef string str;

typedef vector<int> vint;
typedef vector<bool> vbool;
typedef vector<long long> vll;
typedef vector<string> vstr;

typedef pair <int,int> pii;
typedef pair <long long,long long> pll;

typedef vector< vector<int> > mint;
typedef vector< vector<bool> > mbool;
typedef vector< vector<long long> > mll;

const ll LINF = LLONG_MAX;
const int INF = 2000000000;
const double PI = atan(1.0)*4;
const int MOD = 1e9+7;

//------------------------PROBLEM SOLVE---------------------------------
str s;

bool isgl(char c){
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
        return 1;
    }
    return 0;
}

int main(){
    #ifdef _DEBUG_
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast_input();

    cin >> s;

    str sub = "";
    int cnt = 0;
    forn(i, s.sz){
        if(isgl(s[i])){
            sub += s[i];
            cnt = 0;
            continue;
        }

        cnt++;
        if(cnt == 3){
            cout << sub << " ";
            sub = s[i];
        }else{
            sub += s[i];
        }
    }
    cout << sub;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

template<typename XTYPE> inline void _var_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VARIABLE = " << a << endl;
    #endif
}
template<typename XTYPE> inline void _vector_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG VECTOR" << endl; for(auto it = a.begin(); it != a.end(); it++) { cout << *it << " "; } cout << endl << endl;
    #endif
}
template<typename XTYPE> inline void _matrix_(const XTYPE& a){
    #ifdef _DEBUG_
    cout << endl << "DEBUG MATRIX" << endl; for(auto i = a.begin(); i != a.end(); i++) { for(auto j = (*i).begin(); j != (*i).end(); j++) { cout << *j << " "; } cout << endl; } cout << endl << endl;
    #endif
}

//STREAM ACCELERATION - delete 'endl' define and 'tie' in interactive problemes
inline void fast_input(){
    ios_base::sync_with_stdio(false);
}

//FAST CODING HEADER------------------------------------------------
#define forn(i, n)                   for(int i = 0; i < int(n); i++)
#define fori(i, n)                   for(int i = 1; i < int(n); i++)
#define ford(i, n)                   for(int i = int(n) - 1; i >= 0; i--)
#define pb(a)                        push_back(a)
#define all(a)                       a.begin(), a.end()
#define mysort(a, cmp_f)             sort(a.begin(), a.end(), cmp_f)
#define upsort(a)                    sort(a.begin(), a.end())
#define mp(a, b)                     make_pair(a, b)
#define rsz                          resize
#define rsrv                         reserve
#define lwbnd(a, elem)               lower_bound(a.begin(), a.end(), elem)
#define upbnd(a, elem)               upper_bound(a.begin(), a.end(), elem)
#define ins(a)                       insert(a)
#define sz                           size()

typedef long long ll;
typedef long double ld;

typedef string str;

typedef vector<int> vint;
typedef vector<bool> vbool;
typedef vector<long long> vll;
typedef vector<string> vstr;

typedef pair <int,int> pii;
typedef pair <long long,long long> pll;

typedef vector< vector<int> > mint;
typedef vector< vector<bool> > mbool;
typedef vector< vector<long long> > mll;

const ll LINF = LLONG_MAX;
const int INF = 2000000000;
const double PI = atan(1.0)*4;
const int MOD = 1e9+7;

//------------------------PROBLEM SOLVE---------------------------------
str s;

bool isgl(char c){
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
        return 1;
    }
    return 0;
}

int main(){
    #ifdef _DEBUG_
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast_input();

    cin >> s;

    str sub = "";
    int cnt = 0;
    char last = -1;

    forn(i, s.sz){
        if(isgl(s[i])){
            sub += s[i];
            last = -1;
            cnt = 0;
            continue;
        }

        if(last == -1){
            last = s[i];
            cnt++;
        }else{
            if(last != s[i]){
                last = s[i];
                cnt++;
            }
        }

        if(cnt == 3){
            cout << sub << " ";
            sub = s[i];
        }else{
            sub += s[i];
        }
    }
    cout << sub;

    return 0;
}


#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
int main(){
	string s;
	cin >> s;
	int cnt=0;
	string ri="";
	for(int i = 0; i < s.size(); i++){
		if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u') cnt=0;
		else cnt++;
		if(cnt==3){
			cout<<ri<<" ";
			ri="";
			ri+=s[i];
			cnt=1;
			continue;
		}
		ri+=s[i];
	}
	cout<<ri<<endl;
}


#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
int main(){
	string s;
	cin >> s;
	int cnt=0;
	string ri="";
	set <char> se;
	for(int i = 0; i < s.size(); i++){
		if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u'){
		cnt=0;
		se.clear();
		}
		else{
			cnt++;
			se.insert(s[i]);
		}
		if(cnt==3 && se.size()>1){
			cout<<ri<<" ";
			ri="";
			ri+=s[i];
			cnt=1;
			se.clear();
			se.insert(s[i]);
			continue;
		}else if (cnt==3 && se.size()==1){
			cnt=1;
			se.clear();
			se.insert(s[i]);
		}
		ri+=s[i];
	}
	cout<<ri<<endl;
}


#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
int main(){
	string s;
	cin >> s;
	int cnt=0;
	string ri="";
	set <char> se;
	for(int i = 0; i < s.size(); i++){
		if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u'){
		cnt=0;
		se.clear();
		}
		else{
			cnt++;
			se.insert(s[i]);
		}
		if(cnt==3 && se.size()!=1){
			cout<<ri<<" ";
			ri="";
			ri+=s[i];
			cnt=1;
			continue;
		}
		ri+=s[i];
	}
	cout<<ri<<endl;
}


#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
int main(){
	string s;
	cin >> s;
	int cnt=0;
	string ri="";
	set <char> se;
	for(int i = 0; i < s.size(); i++){
		if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u'){
		cnt=0;
		se.clear();
		}
		else{
			cnt++;
			se.insert(s[i]);
		}
		if(cnt==3 && se.size()!=1){
			cout<<ri<<" ";
			ri="";
			ri+=s[i];
			cnt=1;
			se.clear();
			s.insert(s[i]);
			continue;
		}else{
			cnt=1;
			se.clear();
			se.insert(s[i]);
		}
		ri+=s[i];
	}
	cout<<ri<<endl;
}


#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
int main(){
	string s;
	cin >> s;
	int cnt=0;
	string ri="";
	set <char> se;
	for(int i = 0; i < s.size(); i++){
		if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u'){
		cnt=0;
		se.clear();
		}
		else{
			cnt++;
			se.insert(s[i]);
		}
		if(cnt==3 && se.size()>1){
			cout<<ri<<" ";
			ri="";
			ri+=s[i];
			cnt=1;
			se.clear();
			se.insert(s[i]);
			continue;
		}else if (cnt==3 && se.size()==1){
			cnt=2;
			se.clear();
			se.insert(s[i]);
		}
		ri+=s[i];
	}
	cout<<ri<<endl;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define FILE ""

bool f(char c)
{
    if (c == 'a' || c == 'e' || c == 'i' ||
            c == 'o' || c == 'u')
        return 0;
    return 1;
}

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen(FILE".in", "r", stdin);
    //freopen(FILE".out", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    string s;
    cin >> s;
    string a = s;
    set <char> st;
    vector <int> ans(s.size(), 0);
    for (int i = 0; i < s.size(); ++i)
    {
        st.insert(s[i]);
        if (i > 1 && st.size() > 1 && f(s[i - 2]) && f(s[i - 1]) && f(s[i]))
        {
            ans[i] = 1;
            st.clear();
            st.insert(s[i]);
            if (i + 1 < s.size())
                st.insert(s[i + 1]);
            i = min((int)s.size(), i + 2);
        }
    }
    for (int i = 0; i < a.size(); ++i)
    {
        if (ans[i])
            cout << ' ';
        cout << a[i];
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define FILE ""

bool f(char c)
{
    if (c == 'a' || c == 'e' || c == 'i' ||
            c == 'o' || c == 'u')
        return 0;
    return 1;
}

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen(FILE".in", "r", stdin);
    //freopen(FILE".out", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    string s;
    cin >> s;
    string a = s;
    set <char> st;
    vector <int> ans(s.size(), 0);
    for (int i = 0; i < s.size(); ++i)
    {
        st.insert(s[i]);
        if (i > 1 && st.size() > 1 && f(s[i - 2]) && f(s[i - 1]) && f(s[i]))
        {
            ans[i] = 1;
            st.clear();
            st.insert(s[i]);
            if (i + 1 < s.size())
                st.insert(s[i + 1]);
            i += 1;
        }
    }
    for (int i = 0; i < a.size(); ++i)
    {
        if (ans[i])
            cout << ' ';
        cout << a[i];
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define FILE ""

bool f(char c)
{
    if (c == 'a' || c == 'e' || c == 'i' ||
            c == 'o' || c == 'u')
        return 0;
    return 1;
}

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen(FILE".in", "r", stdin);
    //freopen(FILE".out", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    string s;
    cin >> s;
    string a = s;
    map <char,int> st;
    vector <int> ans(s.size(), 0);
    for (int i = 0; i < s.size(); ++i)
    {
        st[s[i]]++;
        if (i > 1 && st.size() > 1 && f(s[i - 2]) && f(s[i - 1]) && f(s[i]))
        {
            ans[i] = 1;
            st.clear();
            st[s[i]]++;
            if (i + 1 < s.size())
                st[s[i + 1]]++;
            i++;
        }
        else if(i > 1)
        {
            st[s[i - 2]]--;
            if (st[s[i - 2]] == 0)
                st.erase(s[i - 2]);
        }
    }
    for (int i = 0; i < a.size(); ++i)
    {
        if (ans[i])
            cout << ' ';
        cout << a[i];
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define FILE ""

bool f(char c)
{
    if (c == 'a' || c == 'e' || c == 'i' ||
            c == 'o' || c == 'u')
        return 0;
    return 1;
}

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen(FILE".in", "r", stdin);
    //freopen(FILE".out", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    string s;
    cin >> s;
    string a = s;
    set <char> st;
    vector <int> ans(s.size(), 0);
    for (int i = 0; i < s.size(); ++i)
    {
        st.insert(s[i]);
        if (i > 1 && st.size() > 1 && f(s[i - 2]) && f(s[i - 1]) && f(s[i]))
        {
            s[i - 1] = 'a';
            ans[i] = 1;
            st.erase(s[i - 2]);
        }
    }
    for (int i = 0; i < a.size(); ++i)
    {
        if (ans[i])
            cout << ' ';
        cout << a[i];
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double

using namespace std;
string s, v;
bool g(char k){
    return (k == 'a' || k == 'e' || k == 'i' || k == 'o' || k == 'u');
}
int main(){

    ios_base::sync_with_stdio(0);

    cin >> s;

    ll tek = 0;
    char t1 = '-', t2 = '-';
    for (ll i = 0; i < s.size(); i++){
        if ( ! g(s[i]) ) {
            if (t1 == '-'){
                t1 = s[i];
                ++tek;
                v += s[i];
            }
            else if (t2 == '-'){
                t2 = s[i];
                ++tek;
                v += s[i];
            }
            else if (s[i] == t1 && s[i] == t2){
                ++tek;
                v += s[i];
            }
            else {
                char k = s[i];
                v += " ";
                cout << v;
                t1 = k;
                t2 = '-';
                tek = 1;
                v = "";
                v += t1;
            }
        }
        else {
            t1 = '-';
            t2 = '-';
            tek = 0;
            v += s[i];
        }
    }
    cout << v;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double

using namespace std;
string s, v;
bool g(char k){
    return (k == 'a' || k == 'e' || k == 'i' || k == 'o' || k == 'u');
}
int main(){

    ios_base::sync_with_stdio(0);

    cin >> s;

    ll tek = 0;
    char t1 = '-', t2 = '-';
    for (ll i = 0; i < s.size(); i++){
        if ( ! g(s[i]) ) {
            if (t1 == '-'){
                t1 = s[i];
                ++tek;
                v += s[i];
            }
            else if (t2 == '-'){
                t2 = s[i];
                ++tek;
                v += s[i];
            }
            else if (s[i] == t1 && s[i] == t2){
                ++tek;
                v += s[i];
            }
            else {
                if (s[i] == t2){
                    char k = v[v.size() - 1];
                    v[v.size() - 1] = ' ';
                    cout << v;
                    t1 = k;
                    tek = 1;
                    v = "";
                    v += t1;
                }
                else {
                    char k = s[i];
                    v += " ";
                    cout << v;
                    t1 = k;
                    tek = 1;
                    v = "";
                    v += t1;
                }
            }
        }
        else {
            t1 = '-';
            t2 = '-';
            tek = 0;
            v += s[i];
        }
        //cout << tek << endl;
    }
    cout << v;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double

using namespace std;
string s, v;
bool g(char k){
    return (k == 'a' || k == 'e' || k == 'i' || k == 'o' || k == 'u');
}
int main(){

    ios_base::sync_with_stdio(0);

    cin >> s;

    ll tek = 0;
    char t1 = '-', t2 = '-';
    for (ll i = 0; i < s.size(); i++){
        if ( ! g(s[i]) ) {
            if (t1 == '-'){
                t1 = s[i];
                ++tek;
                v += s[i];
            }
            else if (t2 == '-'){
                t2 = s[i];
                ++tek;
                v += s[i];
            }
            else if (s[i] == t1 && s[i] == t2){
                ++tek;
                v += s[i];
            }
            else {
                if (s[i] == t2){
                    char k = v[v.size() - 1];
                    v[v.size() - 1] = ' ';
                    cout << v;
                    t1 = k;
                    t2 = s[i];
                    tek = 2;
                    v = "";
                    v += t1;
                    v += t2;
                }
                else {
                    char k = s[i];
                    v += " ";
                    cout << v;
                    t1 = k;
                    t2 = '-';
                    tek = 1;
                    v = "";
                    v += t1;
                }
            }
        }
        else {
            t1 = '-';
            t2 = '-';
            tek = 0;
            v += s[i];
        }
    }
    cout << v;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double

using namespace std;
string s, v;
bool g(char k){
    return (k == 'a' || k == 'e' || k == 'i' || k == 'o' || k == 'u');
}
int main(){

    ios_base::sync_with_stdio(0);

    cin >> s;

    ll tek = 0;
    char t1 = '-', t2 = '-';
    for (ll i = 0; i < s.size(); i++){
        if ( ! g(s[i]) ) {
            if (t1 == '-'){
                t1 = s[i];
                ++tek;
                v += s[i];
            }
            else if (t2 == '-'){
                t2 = s[i];
                ++tek;
                v += s[i];
            }
            else if (s[i] == t1 && s[i] == t2){
                ++tek;
                v += s[i];
            }
            else if (tek + 1 <= 2){
                t1 = t2;
                t2 = s[i];
                v += s[i];
                ++tek;
            }
            else {
                if (s[i] == t2){
                    char k = v[v.size() - 1];
                    v[v.size() - 1] = ' ';
                    cout << v;
                    t1 = k;
                    t2 = s[i];
                    tek = 2;
                    v = "";
                    v += t1;
                    v += t2;
                }
                else {
                    char k = s[i];
                    v += " ";
                    cout << v;
                    t1 = k;
                    tek = 1;
                    v = "";
                    v += t1;
                }
            }
        }
        else {
            t1 = '-';
            t2 = '-';
            tek = 0;
            v += s[i];
        }
        //cout << tek << endl;
    }
    cout << v;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double

using namespace std;
string s, v;
bool g(char k){
    return (k == 'a' || k == 'e' || k == 'i' || k == 'o' || k == 'u');
}
int main(){

    ios_base::sync_with_stdio(0);

    cin >> s;

    ll tek = 0;
    char t1 = '-', t2 = '-';
    for (ll i = 0; i < s.size(); i++){
        if ( ! g(s[i]) ) {
            if (t1 == '-'){
                t1 = s[i];
                ++tek;
                v += s[i];
            }
            else if (t2 == '-'){
                t2 = s[i];
                ++tek;
                v += s[i];
            }
            else if (s[i] == t1 && s[i] == t2){
                ++tek;
                v += s[i];
            }
            else {
                if (s[i] == t2){
                    char k = v[v.size() - 1];
                    v[v.size() - 1] = ' ';
                    cout << v;
                    t1 = k;
                    t2 = s[i];
                    tek = 2;
                    v = "";
                    v += t1;
                    v += t2;
                }
                else {
                    char k = s[i];
                    v += " ";
                    cout << v;
                    t1 = k;
                    tek = 1;
                    v = "";
                    v += t1;
                }
            }
        }
        else {
            t1 = '-';
            t2 = '-';
            tek = 0;
            v += s[i];
        }
        //cout << tek << endl;
    }
    cout << v;
}


#include <bits/stdc++.h>
#define int long long int
#define FF first
#define SS second
#define mp make_pair
#define MOD 1000000007
#define pb push_back

const int md=998244353LL;

using namespace std;
string s;
int ch(char a)
{
  if(a=='a' || a=='e' || a=='i' || a=='o' || a=='u')
    return 1;
  return 0;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output2.txt", "w" , stdout);
  #endif

    cin>>s;

    int n=s.length();

    int last=0;
    int cnt=0;
    for(int i=0;i<n-1;i++)
    {
      if(ch(s[i]))
      {
        cout<<s[i];
        last=i+1;
        cnt=0;
      }
      else
      {
        if(s[i]==s[i+1])
        {
          if(i-last>=2 && s[last]!=s[i])
          {

            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }
        }
        else
        {
          int cnt=i-last;
          if(cnt>=2 && s[i]!=s[i-1])
          {
            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }

        }
      }
    }
    if(n-1-last>=2 && s[last]!=s[n-1])
    cout<<" "<<s[n-1];
    else
      cout<<s[n-1];

    return 0;
}


#include <bits/stdc++.h>
#define int long long int
#define FF first
#define SS second
#define mp make_pair
#define MOD 1000000007
#define pb push_back

const int md=998244353LL;

using namespace std;
string s;
int ch(char a)
{
  if(a=='a' || a=='e' || a=='i' || a=='o' || a=='u')
    return 1;
  return 0;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output2.txt", "w" , stdout);
  #endif

    cin>>s;

    int n=s.length();

    int last=0;
    int cnt=0;
    for(int i=0;i<n-1;i++)
    {
      if(ch(s[i]))
      {
        cout<<s[i];
        last=i+1;
        cnt=0;
      }
      else
      {
        if(s[i]==s[i+1])
        {
          if(i-last>=2 && s[last]!=s[i])
          {

            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }
        }
        else
        {
          int cnt=i-last;
          if(last && cnt>=2 && s[i]!=s[i-1])
          {
            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }

        }
      }
    }
    if(n-1-last>=2 && s[last]!=s[n-1])
    cout<<" "<<s[n-1];
    else
      cout<<s[n-1];

    return 0;
}


#include <bits/stdc++.h>
#define int long long int
#define FF first
#define SS second
#define mp make_pair
#define MOD 1000000007
#define pb push_back

const int md=998244353LL;

using namespace std;
string s;
int ch(char a)
{
  if(a=='a' || a=='e' || a=='i' || a=='o' || a=='u')
    return 1;
  return 0;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output2.txt", "w" , stdout);
  #endif

    cin>>s;

    int n=s.length();

    int last=0;
    int cnt=0;
    for(int i=0;i<n-1;i++)
    {
      if(ch(s[i]))
      {
        cout<<s[i];
        last=i+1;
        cnt=0;
      }
      else
      {
        if(s[i]==s[i+1])
        {
          cout<<s[i];
          last=i;
        }
        else
        {
          int cnt=i-last;
          if(cnt>=2)
          {
            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }

        }
      }
    }
    if(n-1-last>=2)
    cout<<" "<<s[n-1];
    else
      cout<<s[n-1];

    return 0;
}


#include <bits/stdc++.h>
#define int long long int
#define FF first
#define SS second
#define mp make_pair
#define MOD 1000000007
#define pb push_back

const int md=998244353LL;

using namespace std;
string s;
int ch(char a)
{
  if(a=='a' || a=='e' || a=='i' || a=='o' || a=='u')
    return 1;
  return 0;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output2.txt", "w" , stdout);
  #endif

    cin>>s;

    int n=s.length();

    int last=0;
    int cnt=0;
    for(int i=0;i<n-1;i++)
    {
      if(ch(s[i]))
      {
        cout<<s[i];
        last=i+1;
        cnt=0;
      }
      else
      {
        if(s[i]==s[i+1])
        {
          if(i-last>=2 && s[last]!=s[i])
          {

            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }
        }
        else
        {
          int cnt=i-last;
          if(last && cnt>=2 && s[i]!=s[i-1])
          {
            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }

        }
      }
    }
    if(n-1-last>=2)
    cout<<" "<<s[n-1];
    else
      cout<<s[n-1];

    return 0;
}


#include <bits/stdc++.h>
#define int long long int
#define FF first
#define SS second
#define mp make_pair
#define MOD 1000000007
#define pb push_back

const int md=998244353LL;

using namespace std;
string s;
int ch(char a)
{
  if(a=='a' || a=='e' || a=='i' || a=='o' || a=='u')
    return 1;
  return 0;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output2.txt", "w" , stdout);
  #endif

    cin>>s;

    int n=s.length();

    int last;
    if(ch(s[0]))
    {
      cout<<s[0];
      last=1;
    }
    else
    {
      cout<<s[0];
      last=0;
    }

    for(int i=1;i<n;i++)
    {
      if(ch(s[i]))
      {
        cout<<s[i];
        last=i+1;
      }
      else
      {
        if(s[i]==s[i-1])
        {
          if(i-last>=2 && s[i]!=s[last])
          {
            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }
        }
        else
        {
          if(i-last>=2)
          {
            cout<<" "<<s[i];
            last=i;
          }
          else
          {
            cout<<s[i];
          }
        }
      }
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define maxc 123

bool v[123];

int main()
{
    string s;
    int i, cnt = 0, x = 0;
    v['a'] = v['e'] = v['i'] = v['o'] = v['u'] = true;
    cin >> s;
    for(i = 0; i < s.length(); i++)
    {
        if(v[s[i]])
        {
            if(i + 1 == s.length()) cout << s.substr(x, s.length() - x);
            cnt = 0;
        }
        else
            if(cnt == 2)
            {
                if(!(s[i - 2] == s[i - 1] && s[i - 1] == s[i]))
                {
                    cout << s.substr(x, i - x) << " ";
                    x = i;
                }
                i--;
                cnt = 0;
            }
            else
            {
                cnt++;
                if(i + 1 == s.length()) cout << s.substr(x, s.length() - 1);
            }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define maxc 123

bool v[123];

int main()
{
    string s;
    int i, cnt = 0, x = 0;
    v['a'] = v['e'] = v['i'] = v['o'] = v['u'] = true;
    cin >> s;
    for(i = 0; i < s.length(); i++)
    {
        if(v[s[i]])
        {
            if(i + 1 == s.length()) cout << s.substr(x, s.length() - x);
            cnt = 0;
        }
        else
            if(cnt == 2)
            {
                if(!(s[i - 2] == s[i - 1] && s[i - 1] == s[i]))
                {
                    cout << s.substr(x, i - x) << " ";
                    x = i;
                }
                i--;
                cnt = 0;
            }
            else
            {
                cnt++;
                if(i + 1 == s.length()) cout << s.substr(x, s.length() - x);
            }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define maxc 123

bool v[123];

int main()
{
    string s;
    int i, cnt = 0, x = 0, k;
    v['a'] = v['e'] = v['i'] = v['o'] = v['u'] = true;
    cin >> s;
    for(i = 0; i < s.length(); i++)
    {
        if(v[s[i]])
        {
            if(i + 1 == s.length()) cout << s.substr(x, s.length() - x);
            cnt = 0;
        }
        else
            if(cnt == 2)
            {
                if(s[i - 2] == s[i - 1] && s[i - 1] == s[i])
                {
                    for(k = i; k < s.length(); k++)
                        if(s[k] != s[i])
                        {
                            if(!ok[s[k]])
                            {
                                cout << s.substr(x, k - x) << " ";
                                x = k;
                            }
                            i = k - 1;
                            break;
                        }
                        else
                            if(k + 1 == s.length())
                            {
                                cout << s.substr(x, s.length() - x);
                                return 0;
                            }
                }
                else
                {
                    cout << s.substr(x, i - x) << " ";
                    x = i;
                    i--;
                }
                cnt = 0;
            }
            else
            {
                cnt++;
                if(i + 1 == s.length()) cout << s.substr(x, s.length() - x);
            }
    }
    return 0;
}