#include <bits/stdc++.h>
using namespace std;
#define clr(a,x) memset(a, x, sizeof(a))
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define X first
#define Y second
#define fastin ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef vector<int> VI;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-6;

const int maxn = 1e5 + 5;
int par[maxn], val[maxn];

void init(int n)
{
    for (int i = 1; i <= n; i++)
        par[i] = i, val[i] = 0;
}

int find(int x)
{
    if (par[x] == x) return x;
    int tmp = find(par[x]);
    val[x] ^= val[par[x]];
    return par[x] = tmp;
}

int main()
{
#ifndef ONLINE_JUDGE
//    freopen("1.in", "r", stdin);
//    freopen("1.out", "w", stdout);
#endif
    fastin
    int n, m;
    cin >> n >> m;
    init(n);
    while (m--)
    {
        int u, v, w;
        cin >> u >> v >> w;
        int t1 = find(u), t2 = find(v);
        if (t1 != t2)
        {
            val[t2] = val[u] ^ val[v] ^ w ^ 1;
            par[t2] = t1;
        }
        else
        {
            if (val[u] == val[v] && w == 0)
            {
                puts("0");
                return 0;
            }
            if (val[u] != val[v] && w == 1)
            {
                puts("0");
                return 0;
            }
        }
    }
    ll ans = (mod - mod / 2) % mod;
    for (int i = 1; i <= n; i++)
        if (find(i) == i)
            ans = (ans + ans) % mod;
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define clr(a,x) memset(a, x, sizeof(a))
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define X first
#define Y second
#define fastin ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef vector<int> VI;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-6;

const int maxn = 1e5 + 5;
int par[maxn], val[maxn];

void init(int n)
{
    for (int i = 1; i <= n; i++)
        par[i] = i, val[i] = 0;
}

int find(int x)
{
    if (par[x] == x) return x;
    int tmp = find(par[x]);
    val[x] ^= val[par[x]];
    return par[x] = tmp;
}

int main()
{
#ifndef ONLINE_JUDGE
//    freopen("1.in", "r", stdin);
//    freopen("1.out", "w", stdout);
#endif
    fastin
    int n, m;
    cin >> n >> m;
    init(n);
    while (m--)
    {
        int u, v, w;
        cin >> u >> v >> w;
        int t1 = find(u), t2 = find(v);
        if (t1 != t2)
        {
            val[t2] = val[u] ^ val[v] ^ w;
            par[t2] = t1;
        }
        else
        {
            if (val[u] == val[v] && w == 1)
            {
                puts("0");
                return 0;
            }
            if (val[u] != val[v] && w == 0)
            {
                puts("0");
                return 0;
            }
        }
    }
    ll ans = (mod - mod / 2) % mod;
    for (int i = 1; i <= n; i++)
        if (find(i) == i)
            ans = (ans + ans) % mod;
    cout << ans << endl;
    return 0;
}


//
//  main.cpp
//  Codeforces Round #309 (Div. 2) E
//
//  Created by Scholar on 6/26/15.
//  Copyright (c) 2015 Scholar. All rights reserved.
//

#include<iostream>
#include<cstdio>
using namespace std;
const int Maxn=1e5+100,mod=1e9+7;int n,m,f[2*Maxn];
int find(int x){return f[x]==x?x:f[x]=find(f[x]);}
void merge(int x,int y){x=find(x);y=find(y);if(x!=y)f[x]=y;}
int main(int argc, const char * argv[]) {
    ios::sync_with_stdio(0);
    int i;cin>>n>>m;
    for(i=1;i<=2*n;i++)f[i]=i;
    for(i=1;i<=m;i++){int a,b,c;cin>>a>>b>>c;if(c==1){if(find(a+n)==find(b)){puts("0");return 0;}merge(a,b);merge(a+n,b+n);}else{if(find(a)==find(b)){puts("0");return 0;}merge(a+n,b);merge(a,b+n);}}
    int cnt=0;for(i=1;i<=n;i++){
        if(f[i]==i)cnt++;}cnt--;
    int ans=1,base=2;while(cnt){if(cnt&1){ans=1LL*ans*base%mod;}
        base=1LL*base*base%mod;cnt>>=1;}
    printf("%d\n",ans);
    return 0;
}


#include<bits/stdc++.h>
#define MOD 1000000007

using namespace std;

int viz[100005], viz2[100005];
vector<pair<int, int> > v[100005];

void dfs(int node) {
    viz2[node] = 1;
    for(int i = 0; i < v[node].size(); ++i) {
        if(viz2[v[node][i].first] == 0)
            dfs(v[node][i].first);
    }
}

bool ok = true;
void check(int node, int mark) {
    viz[node] = mark;
    for(int i = 0; i < v[node].size(); ++i) {
        if(viz[v[node][i].first] == 0)
            if(v[node][i].second == 0)
                check(v[node][i].first, -mark);
                else
                check(v[node][i].first, mark);
        else {
            if(viz[v[node][i].first] != -mark && v[node][i].second == 0)
                ok = false;
            if(viz[v[node][i].first] != mark && v[node][i].second == 1)
                ok = false;
        }
    }
}
int main()
{
    int n, m, a, b, c;

    cin >> n >> m;

    for(int i = 0; i < m; ++i){
        cin >> a >> b >> c;
        --a; --b;
        v[a].push_back(make_pair(b, c));
        v[b].push_back(make_pair(a, c));
    }

    for(int i = 0; i < n; ++i) {
        if(viz[i] == 0)
            check(i, 1);
    }
    int nrComp = 0;
    for(int i = 0; i < n; ++i){
        if(viz2[i] == 0) {
            dfs(i);
            ++nrComp;
        }
    }
    if(ok == false)
        cout << 0;
    else {
        long long ans = 1;
        for(int i = 0; i < nrComp - 1; ++i)
            ans = (ans * 2) % MOD;
        cout << ans;
    }

}


#include <bits/stdc++.h>

using namespace std;

#define rep(x, y, z) for (int x = y; x < z; x++)
#define pb(i) push_back(i)
#define mp(i, j) make_pair(i, j)
#define pii pair<int, int>
#define ll long long

const int Maxn = 200000, D = 1000000007;
int n, m, mark[Maxn];
ll ans = 1;
vector <pii> nei[Maxn];

void input()
{
    int a, b, c;
    cin >> n >> m;
    rep(i, 0, m) {
        cin >> a >> b >> c;
        a--; b--;
        nei[a].pb(mp(b, c)), nei[b].pb(mp(a, c));
    }
}
bool dfs(int u, int c)
{
    mark[u] = c;
    for(auto v: nei[u])
        if (v.second == 1) {
            if (mark[v.first] == 3 - c)
                return false;
            if (!mark[v.first])
                if (!dfs(v.first, c))
                    return false;
        }
        else {
            if(mark[v.first] == c)
                return false;
            if (!mark[v.first])
                if (!dfs(v.first, 3 - c))
                    return false;
        }
    return true;
}
int dfs_all()
{
    int ted = 0;
    rep(i, 0, n)
        if (!mark[i]) {
            if (!dfs(i, 1))
                return 0;
            ted++;
        }
    return ted;
}
int main()
{
    input();
    ll t = dfs_all();
    rep(i, 1, t)
        ans = (ans * 2) % D;
    cout << ( t ? ans : 0 ) << endl;
    return 0;
}


// IN THE NAME OF ALLAH
#include <math.h>
#include <vector>
#include <set>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <stack>
#include<cstring>
#include <cstdlib>
#include <string>
#include <ctime>
#include <cstdio>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

#define F first
#define S second
#define mp make_pair
#define L(x) (2*(x))
#define R(x) ((2*(x))+1)
#define pii pair<int , int>

using namespace std;
typedef long long ll;

const int N = 5e6 + 5, Mod = 1e9 + 7, MAXN = 3e5 + 10, LG = 20 , M = 1e9, P = 727, Sq = 550;
const ll inf = 3e18 + 10;

int red[N], blue[N], pw[N], cnt = 0, n, m;
vector< int > b[N], r[N], adj[N];
map< pair< int, int >, int > mm;

void predfs(int u){
      red[u] = cnt;
      for(int i = 0; i < (int)r[u].size(); i++)
            if(!red[r[u][i]])
                  predfs(r[u][i]);
}
void Check(int u){
      if(!blue[u])
            blue[u] = 1;
      for(int i = 0; i < (int)adj[u].size(); i++){
            if(blue[adj[u][i]] == blue[u]){
                  cout << 0;
                  exit(0);
            }
            if(!blue[adj[u][i]]){
                  blue[adj[u][i]] = 3 - blue[u];
                  Check(adj[u][i]);
            }
      }
}
int main(){
      ios_base::sync_with_stdio(0); cin.tie(0);
      pw[0] = 1;
      for(int i = 1; i < N; i++)
            pw[i] = 1ll * pw[i - 1] * 2 % Mod;
      cin >> n >> m;
      for(int i = 1; i <= m; i++){
            int x, y, z; cin >> x >> y >> z;
            if(z)
                  r[x].push_back(y), r[y].push_back(x);
            else
                  b[x].push_back(y), b[y].push_back(x);
      }
      for(int i = 1; i <= n; i++)
            if(!red[i])
                  cnt++, predfs(i);
      for(int i = 1; i <= n; i++)
            for(int j = 0; j < (int)b[i].size(); j++)
                  if(red[i] == red[b[i][j]] && red[i])
                        return cout << 0, 0;
      for(int i = 1; i <= n; i++){
            for(int j = 0; j < (int)b[i].size(); j++){
                  int x = red[i], y = red[b[i][j]];
                  if(x > y)
                        swap(x, y);
                  if(!mm[mp(x, y)]){
                        mm[mp(x, y)] = 1;
                        adj[x].push_back(y);
                        adj[y].push_back(x);
                  }
            }
      }
      int num = 0;
      for(int i = 1; i <= cnt; i++){
            if(!blue[i]){
                  Check(i);
                  num++;
            }
      }
      return cout << pw[num - 1], 0;
}//hellobig_tq


#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
const int mod = (int)(1e9) + 7;
const int N = 100000 + 100;
int fa[N];
int n,m;
struct edges{
	int x,y,z;
}e[N];
int getfa(int x){
	return fa[x] == x ? x : fa[x] = getfa(fa[x]);
}
void merge(int x,int y){
	int t1 = getfa(x),t2 = getfa(y);
	fa[t1] = t2;
}
int bothinside(int x,int y){
	int t1 = getfa(x),t2 = getfa(y);
	return t1 == t2;
}
int b[N],h[N],nxt[N * 2],adj[N * 2],tot,color[N];
void addedge(int x,int y){
	adj[++ tot] = y,nxt[tot] = h[x],h[x] = tot;
}
int paint(int u,int id){
	color[u] = id;
	for (int k = h[u];k;k = nxt[k]){
		int v = adj[k];
		if (color[v] != 0){
			if (color[v] == id) return 0;
		}else{
			if (!paint(v,-id)) return 0;
		}
	}
	return 1;
}
void solve(){
	for (int i = 1;i <= m;i ++){
		if (e[i].z == 0 && bothinside(e[i].x,e[i].y)){
			cout << 0 << endl;
			return;
		}
	}
	for (int i = 1;i <= n;i ++){
		fa[i] = getfa(i);
		b[i] = fa[i];
	}
	sort(b + 1,b + 1 + n);
	int dif = unique(b + 1,b + 1 + n) - b - 1;
	tot = 0;
	for (int i = 1;i <= m;i ++){
		if (e[i].z == 0){
			int x = fa[e[i].x],y = fa[e[i].y];
			addedge(x,y),addedge(y,x);
		}
	}
	int cnt = 0;
	for (int i = 1;i <= dif;i ++){
		if (color[b[i]] != 0) continue;
		if (!paint(b[i],-1)){
			cout << 0 << endl;
			return;
		}else ++ cnt;
	}
	int ans = 1;
	for (int i = 1;i < cnt;i ++) ans = ans * 2 % mod;
	cout << ans << endl;
}
int main(){
	cin >> n >> m;
	for (int i = 1;i <= n;i ++) fa[i] = i;
	for (int i = 1;i <= m;i ++){
		cin >> e[i].x >> e[i].y >> e[i].z;
		if (e[i].z == 1) merge(e[i].x,e[i].y);
	}
	solve();
	return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<cmath>
#include<cassert>
#include<vector>
#include<algorithm>
#include<queue>
#include<list>
#include<limits>
#define CIN(n) scanf("%d",&n)
#define CINL(n) cin>>n
#define CINF(n) scanf("%f",&n)
#define FOR(i,j,n) for(i=j;i<=n;i++)
#define FORR(i,j,n) for(i=j;i>=n;i--)
#define SORT(n) std::sort(n.begin(),n.end())
#define FILL(n,a) std::fill(n.begin(),n.end(),a)
#define ALL(n) n.begin(),n.end()
#define rsz resize
#define pb push_back
#define MAXINT std::numeric_limits<int>::max()
#define MININT std::numeric_limits<int>::min()
#define getchar gc
#define putchar pc
#define iOS std::ios_base::sync_with_stdio(false)
#define endl "\n"
#define debug(x) cout << #x << " = " << x << endl
#define MAXN 112345
#define M 1000000007
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<bool> VB;
typedef vector<vector<int> > VVI;
typedef vector<vector<ll> > VVL;
int parent[MAXN];
int cont[MAXN];
int gid[MAXN];
struct element
{
	int a;
	int b;
	int c;
};
int find(int i)
{
	if(parent[i]!=i)
	{
		parent[i]=find(parent[i]);
		return(parent[i]);
	}
	return i;
}
void munion(int a,int b)
{
	int fa=find(a);
	int fb=find(b);
	if(fa==fb)
		return;
	if(cont[fa]>=cont[fb])
	{
		parent[fb]=fa;
		cont[fa]+=cont[fb];
	}
	else
	{
		parent[fa]=fb;
		cont[fb]+=cont[fa];
	}
}
std::vector<std::list<int> > graph;
element g[MAXN];
queue<int> q;
bool done[MAXN];
ll mpow2(int n)
{
	ll N=ll(n);
	ll ret=1LL;
	ll a=2LL;
	while(N>0LL)
	{
		if(N&1LL)
		{
			ret=(ret*a)%M;
		}
		a=(a*a)%M;
		N>>=1LL;
	}
	return ret;
}
int main()
{
	iOS;
	int n,m;
	cin>>n>>m;
	int i;
	FOR(i,1,n)
		parent[i]=i;

	FOR(i,1,n)
		cont[i]=1;

	int a,b,c;
	FOR(i,0,m-1)
		cin>>g[i].a>>g[i].b>>g[i].c;
	FOR(i,0,m-1)
	{
		if(g[i].c==1)
			munion(g[i].a,g[i].b);
	}
	int ng=0;
	std::fill(gid,gid+MAXN,-1);
	FOR(i,1,n)
	{
		if(parent[i]==i)
		{
			gid[i]=ng;
			ng++;
		}
	}
	graph.resize(ng);
	FOR(i,0,m-1)
	{
		if(g[i].c==0)
		{
			int fa=find(g[i].a);
			int fb=find(g[i].b);
			if(fa==fb)
			{
				cout<<"0";
				return 0;
			}
			int ga=gid[fa];
			int gb=gid[fb];
			graph[ga].push_back(gb);		//THE ADJACENCY LIST MAY CONTAIN DUPLICATES
			graph[gb].push_back(ga);
		}
	}

	//
	assert(q.empty());
	//

	int nc=0;
	memset(done,false,sizeof(done));
	FOR(i,0,ng-1)
	{
		if(!done[i])
		{
			nc++;
			q.push(i);
			while(!q.empty())
			{
				int p=q.front();
				if(!done[p])
				{
					done[p]=true;
					std::list<int>::iterator it=graph[p].begin();
					for(std::list<int>::iterator it=graph[p].begin();it!=graph[p].end();it++)
					{
						int y=(*it);
						if(!done[y])
							q.push(y);
					}
				}
				q.pop();
			}
		}
	}
	if(nc!=0)
		cout<<mpow2(nc-1);
	else
		cout<<"0";
	return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<cmath>
#include<cassert>
#include<vector>
#include<algorithm>
#include<queue>
#include<list>
#include<limits>
#define CIN(n) scanf("%d",&n)
#define CINL(n) cin>>n
#define CINF(n) scanf("%f",&n)
#define FOR(i,j,n) for(i=j;i<=n;i++)
#define FORR(i,j,n) for(i=j;i>=n;i--)
#define SORT(n) std::sort(n.begin(),n.end())
#define FILL(n,a) std::fill(n.begin(),n.end(),a)
#define ALL(n) n.begin(),n.end()
#define rsz resize
#define pb push_back
#define MAXINT std::numeric_limits<int>::max()
#define MININT std::numeric_limits<int>::min()
#define getchar gc
#define putchar pc
#define iOS std::ios_base::sync_with_stdio(false)
#define endl "\n"
#define debug(x) cout << #x << " = " << x << endl
#define RED 2
#define BLUE 1
#define UNCOLORED 0
#define MAXN 112345
#define M 1000000007
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<bool> VB;
typedef vector<vector<int> > VVI;
typedef vector<vector<ll> > VVL;
int parent[MAXN];
int cont[MAXN];
int gid[MAXN];
struct element
{
	int a;
	int b;
	int c;
};
int find(int i)
{
	if(parent[i]!=i)
	{
		parent[i]=find(parent[i]);
		return(parent[i]);
	}
	return i;
}
void munion(int a,int b)
{
	int fa=find(a);
	int fb=find(b);
	if(fa==fb)
		return;
	if(cont[fa]>=cont[fb])
	{
		parent[fb]=fa;
		cont[fa]+=cont[fb];
	}
	else
	{
		parent[fa]=fb;
		cont[fb]+=cont[fa];
	}
}
std::vector<std::list<int> > graph;
element g[MAXN];
queue<int> q;
bool done[MAXN];
ll mpow2(int n)
{
	ll N=ll(n);
	ll ret=1LL;
	ll a=2LL;
	while(N>0LL)
	{
		if(N&1LL)
		{
			ret=(ret*a)%M;
		}
		a=(a*a)%M;
		N>>=1LL;
	}
	return ret;
}
int color[MAXN];
int main()
{
	iOS;
	int n,m;
	cin>>n>>m;
	int i;
	FOR(i,1,n)
		parent[i]=i;

	FOR(i,1,n)
		cont[i]=1;

	int a,b,c;
	FOR(i,0,m-1)
		cin>>g[i].a>>g[i].b>>g[i].c;
	FOR(i,0,m-1)
	{
		if(g[i].c==1)
			munion(g[i].a,g[i].b);
	}
	int ng=0;
	std::fill(gid,gid+MAXN,-1);
	FOR(i,1,n)
	{
		if(parent[i]==i)
		{
			gid[i]=ng;
			ng++;
		}
	}
	graph.resize(ng);
	FOR(i,0,m-1)
	{
		if(g[i].c==0)
		{
			int fa=find(g[i].a);
			int fb=find(g[i].b);
			if(fa==fb)
			{
				cout<<"0";
				return 0;
			}
			int ga=gid[fa];
			int gb=gid[fb];
			graph[ga].push_back(gb);		//THE ADJACENCY LIST MAY CONTAIN DUPLICATES
			graph[gb].push_back(ga);
		}
	}

	//
	assert(q.empty());
	//
	memset(color,UNCOLORED,sizeof(color));
	int nc=0;
	memset(done,false,sizeof(done));
	int tb;
	int nb;
	FOR(i,0,ng-1)
	{
		if(!done[i])
		{
			nc++;
			q.push(i);
			color[i]=RED;
			while(!q.empty())
			{
				int p=q.front();
				if(color[p]==RED)
				{
					tb=BLUE;
					nb=RED;
				}
				else
				{
					tb=RED;
					nb=BLUE;
				}
				if(!done[p])
				{
					done[p]=true;
					std::list<int>::iterator it=graph[p].begin();
					for(std::list<int>::iterator it=graph[p].begin();it!=graph[p].end();it++)
					{
						int y=(*it);
						if(color[y]==UNCOLORED)
							color[y]=tb;
						else if(color[y]==nb)
						{
							cout<<'0';
							return 0;
						}
						if(!done[y])
							q.push(y);
					}
				}
				q.pop();
			}
		}
	}
	if(nc!=0)
		cout<<mpow2(nc-1);
	else
		cout<<"0";
	return 0;
}


#include<stdio.h>
#include<string>
#include<map>
#include<iostream>
#include<algorithm>
using namespace std;
map<char,int>m;
int b[100000];
int vis[100000];
int judge(char a)
{
    if(a=='a'||a=='e'||a=='i'||a=='o'||a=='u')
        return 1;
    else
        return 0;
}
int main()
{
    string s;
    cin>>s;
    int x=0;
    for(int i=0; i<s.size(); i++)
    {
        if(judge(s[i])==1)
        {
            x=0;
        }
        else
            x++;
        if(x>2&&(s[i]!=s[i-1]||s[i-1]!=s[i-2]))
        {
            cout<<" ";
            x=1;
        }
        cout<<s[i];
    }
    cout<<endl;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char st[3003];
char cur[6006];
int main()
{
    scanf("%s",&st);
    char er,p;
    int check=0;
    bool change=false;
    int c=strlen(st);
    int j=0;
    for(int i=0;i<c;)
    {
        p=st[i];
        if(p=='a'||p=='e'||p=='i'||p=='u'||p=='o')
        {
            check=0;
            cur[j++]=p;
            i++;
        }
        else
        {
            if(check>=2&&st[i]!=st[i-1])
            {
                cur[j++]=' ';
                cur[j++]=st[i++];
             //   cout<<st[i]<<endl;
                change=true;
                check=1;
            }
            else
            {
                check++;
                cur[j++]=st[i++];
            }
        }
    }
  //  cur[j++]='\0';
    printf("%s",cur);
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char st[3003];
char cur[6006];
bool jud(int k)
{
    if(st[k]==st[k-1]&&st[k-1]==st[k-2])
        return false;
    return true;
}
int main()
{
    scanf("%s",&st);
    char er,p;
    int check=0;
    bool change=false;
    int c=strlen(st);
    int j=0;
    for(int i=0;i<c;)
    {
        p=st[i];
        if(p=='a'||p=='e'||p=='i'||p=='u'||p=='o')
        {
            check=0;
            cur[j++]=p;
            i++;
        }
        else
        {
            if(check>=2&&jud(i))
            {
                cur[j++]=' ';
                cur[j++]=st[i++];
             //   cout<<st[i]<<endl;
                change=true;
                check=1;
            }
            else
            {
                check++;
                cur[j++]=st[i++];
            }
        }
    }
  //  cur[j++]='\0';
    printf("%s",cur);
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int n=3100;
int main()
{
	char str[n];
	scanf("%s",str);
	int len=strlen(str);
	for(int i=0,j=0 ; i<len ;i++)
	{
		int num=0;
		while(j<len)
		{
			if(str[j]=='a' || str[j]=='e' || str[j]=='i' || str[j]=='o' || str[j]=='u')
				num=0;
			else
			{
				num++;
				if(str[j]==str[j+1] && str[j]==str[j+2])
					num--;
			}
			if(num==3) break;
			printf("%c",str[j]);
			j++;
		}
		printf(" ");
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int n=3100;
int main()
{
	char str[n];
	scanf("%s",str);
	int len=strlen(str);
	for(int i=0,j=0 ; i<len ;i++)
	{
		int num=0;
		while(j<len && num<3)
		{
			if(str[j]=='a' || str[j]=='e' || str[j]=='i' || str[j]=='o' || str[j]=='u')
				num=0;
			else
			{
				num++;
				if(num==3)
				{
					if(str[j]==str[j+1] && str[j]==str[j+2])
					    num--;
					else
						break;
				}
			}
			printf("%c",str[j]);
			j++;
		}
		printf(" ");
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int n=3100;
int main()
{
	char str[n];
	scanf("%s",str);
	int len=strlen(str);
	for(int i=0,j=0 ; i<len ;i++)
	{
		int num=0;
		while(j<len && num<3)
		{
			if(str[j]=='a' || str[j]=='e' || str[j]=='i' || str[j]=='o' || str[j]=='u')
				num=0;
			else
			{
				num++;
				if(num==3)
				{
					if(str[j]==str[j-1] && str[j-1]==str[j-2])
					    num--;
					else
						break;
				}
			}
			printf("%c",str[j]);
			j++;
		}
		printf(" ");
	}
	return 0;
}


#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

bool is_consonant(char c)
{
	if (c == 'a') return false;
	if (c == 'e') return false;
	if (c == 'i') return false;
	if (c == 'o') return false;
	if (c == 'u') return false;
	return true;
}

void fix_typos(string s)
{
	if (s.length() < 3)
	{
		cout << s;
		return;
	}

	int i = 0;
	for (; i <= s.length() - 3; i++)
	{
		if (is_consonant(s[i])
				&& is_consonant(s[i + 1])
				&& is_consonant(s[i + 2]))
				{
					cout << s.substr(0, i + 2) << " ";
					fix_typos(s.substr(i + 2, s.length() - i - 2));
							break;
							}
							}
	if (i > s.length() - 3) cout << s;
							}
int main()
{
	string s;
	cin >> s;
	fix_typos(s);
	return 0;
}


#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

bool equal(string s, int i, int j, int k)
{
	if (s[i] == s[j] && s[j] == s[k]) return true;
	return false;
}

bool is_consonant(char c)
{
	if (c == 'a') return false;
	if (c == 'e') return false;
	if (c == 'i') return false;
	if (c == 'o') return false;
	if (c == 'u') return false;
	return true;
}

void fix_typos(string s)
{
	if (s.length() < 3)
	{
		cout << s;
		return;
	}

	int i = 0;
	for (; i <= s.length() - 3; i++)
	{
		if (is_consonant(s[i])
				&& is_consonant(s[i + 1])
				&& is_consonant(s[i + 2])
				&& !equal(s, i, i + 1, i + 2))
				{
					cout << s.substr(0, i + 2) << " ";
					fix_typos(s.substr(i + 2, s.length() - i - 2));
							break;
							}
							}
	if (i > s.length() - 3) cout << s;
							}
int main()
{
	string s;
	cin >> s;
	fix_typos(s);
	return 0;
}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
bool aaa(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u')
        return true;//辅音
    else return false;
}
char s[3005];
char b[5000];
int main()
{
    while(~scanf("%s",s))
    {
        int l=strlen(s);
        int cnt=0;
        int r=0;
        for(int i=0;i<l;i++)
        {
            b[r++]=s[i];
            if(aaa(s[i]))
                cnt++;
            if(cnt>=2&&aaa(s[i+1]))
            {
                if(s[i+1]!=s[i])
                {
                 b[r++]=' ';
                 cnt=0;
                }
            }
            if(!aaa(s[i]))
                cnt=0;
        }
        for(int i=0;i<r;i++)
            printf("%c",b[i]);
        printf("\n");
    }
}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
bool aaa(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u')
        return true;//辅音
    else return false;
}
char s[3005];
char b[5000];
int main()
{
    while(~scanf("%s",s))
    {
        int l=strlen(s);
        int cnt=0;
        int r=0;
        for(int i=0;i<l;i++)
        {
            b[r++]=s[i];
            if(aaa(s[i]))
                cnt++;
            if(cnt>=2&&aaa(s[i+1]))
            {
                if(s[i+1]!=s[i])
                {
                 b[r++]=' ';
                 cnt=0;
                }
            }
            if(!aaa(s[i]))
                cnt=0;
        }
        for(int i=0;i<=r;i++)
            printf("%c",b[i]);
        printf("\n");
    }
}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
bool aaa(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u')
        return true;//辅音
    else return false;
}
char s[3005];
char b[5000];
int main()
{
    while(~scanf("%s",s))
    {
        int l=strlen(s);
        int cnt=0;
        int r=0;
        for(int i=0;i<l;i++)
        {
            b[r++]=s[i];
            if(aaa(s[i]))
                cnt++;
            if(!aaa(s[i]))
                cnt=0;
            if(cnt>=2&&s[i+1]!='\0'&&aaa(s[i+1]))
            {
               // printf("11=%d\n",cnt);
                if(s[i+1]!=s[i])
                {
                 b[r++]=' ';
                 cnt=0;
                }
                if(s[i+1]==s[i]&&s[i+1]!=s[i-1])
                {
                    b[r++]=' ';
                    cnt=0;
                }
            }
//             if(!aaa(s[i]))
//                cnt=0;
        }
        for(int i=0;i<r;i++)
            printf("%c",b[i]);
        printf("\n");
    }
}


#include <iostream>

using namespace std;
int check(char a)
{
    if(a=='a' ||a=='e' ||a=='i' ||a=='o' ||a=='u')
    return 0;
    else
        return 1;
}
int main()
{
    char str[3000];
    cin>>str;
    int arr[3000];
    for(int i=0;i<3000;i++)
        arr[i]=0;
    for(int i=1;str[i];i++)
        if(check(str[i]) && check(str[i+1]) && check(str[i-1]))
            arr[++i]=1;
    for(int i=0;str[i];i++)
        {if(arr[i])
                cout<<' ';
        cout<<str[i];
        }
}


#include <iostream>

using namespace std;
int check(char a)
{
    if(a=='a' ||a=='e' ||a=='i' ||a=='o' ||a=='u')
    return 0;
    else
        return 1;
}
int main()
{
    char str[3000];
    cin>>str;
    int arr[3000];
    for(int i=0;i<3000;i++)
        arr[i]=0;
    for(int i=1;str[i];i++)
        if(check(str[i]) && check(str[i+1]) && check(str[i-1]) && (str[i]!=str[i+1] || str[i]!=str[i-1] || str[i+1]!=str[i-1]))
            arr[++i]=1;
    for(int i=0;str[i];i++)
        {if(arr[i])
                cout<<' ';
        cout<<str[i];
        }
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#define MAXN 3010
using namespace std;
map<char,bool>hash;
char s[MAXN],mid[MAXN];
int ask(char x)
{
	return x=='a'||x=='e'||x=='i'||x=='o'||x=='u';
}
int main(int argc, char const *argv[])
{
	scanf("%s",&s);
	int l=strlen(s);
	int ans=0;
	if(!ask(s[0])) ans++;printf("%c",s[0]);
	for(int i=1;i<l;i++){
		if(ask(s[i])){
			ans=0;
		}
		else{
			ans++;
			if(ans>=3&&(s[i]!=s[i-1]||s[i-2]!=s[i-1])){
				printf(" ");
				ans=1;
			}
		}
		printf("%c",s[i]);
	}
	system("pause");return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#define MAXN 3010
using namespace std;
map<char,bool>hash;
char s[MAXN],mid[MAXN];
int ask(char x)
{
	return x=='a'||x=='e'||x=='i'||x=='o'||x=='u';
}
int main(int argc, char const *argv[])
{
	scanf("%s",&s);
	int l=strlen(s);
	int ans=0;bool flag=false;
	if(!ask(s[0])) ans++;printf("%c",s[0]);
	for(int i=1;i<l;i++){
		if(ask(s[i])){
			ans=0;flag=false;
		}
		else{
			ans++;
			if(s[i]!=s[i-1]) flag=true;
			if(ans>=3&&flag){
				printf(" ");
				ans=1;flag=false;
			}
		}
		printf("%c",s[i]);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#define MAXN 3010
using namespace std;
map<char,bool>hash;
char s[MAXN],mid[MAXN];
int ask(char x)
{
	return x=='a'||x=='e'||x=='i'||x=='o'||x=='u';
}
int main(int argc, char const *argv[])
{
	scanf("%s",&s);
	int l=strlen(s);
	int ans=0;
	if(!ask(s[0])) ans++;printf("%c",s[0]);
	for(int i=1;i<l;i++){
		if(ask(s[i])){
			ans=0;
		}
		else{
			ans++;
			if(ans>=3&&(s[i]!=s[i-1]||s[i-2]!=s[i-1])){
				printf(" ");
				ans=1;
			}
		}
		printf("%c",s[i]);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#define MAXN 3010
using namespace std;
char s[MAXN];
int ask(char x)
{
    return x=='a'||x=='e'||x=='i'||x=='o'||x=='u';
}
int main(int argc, char const *argv[])
{
    scanf("%s",&s);
    int l=strlen(s);
    int ans=0;//ans��¼�����鳤��
    if(!ask(s[0])) ans++;printf("%c",s[0]);
    for(int i=1;i<l;i++){
        if(ask(s[i])){
            ans=0;//ǰ��ĸ������Ѵ���ans����
        }
        else{
            ans++;
            if(ans>=3&&(s[i]!=s[i-1]||s[i-2]!=s[i-1])){
            	//����˸����鲻�Ϸ�
                printf(" ");
                ans=1;//ע����1����Ϊ��ǰ�ַ��ǻ��ֺ�����Ŀ�ͷ
            }
        }
        printf("%c",s[i]);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#define MAXN 3010
using namespace std;
char s[MAXN];
int ask(char x)
{
	return x=='a'||x=='e'||x=='i'||x=='o'||x=='u';
}
int main(int argc, char const *argv[])
{
	scanf("%s",&s);
	int l=strlen(s);
	int ans=0;
	if(!ask(s[0])) ans++;printf("%c",s[0]);
	for(int i=1;i<l;i++){
		if(ask(s[i])){
			ans=0;
		}
		else{
			ans++;
			if(ans>=3&&(s[i]!=s[i-1]||s[i-2]!=s[i-1])){
				printf(" ");
				ans=1;
			}
		}
		printf("%c",s[i]);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#define MAXN 3010
using namespace std;
map<char,bool>hash;
char s[MAXN],mid[MAXN];
int ask(char x)
{
	return x=='a'||x=='e'||x=='i'||x=='o'||x=='u';
}
int main(int argc, char const *argv[])
{
	scanf("%s",&s);
	int l=strlen(s);
	int ans=0;bool flag=false;
	if(!ask(s[0])) ans++;printf("%c",s[0]);
	for(int i=1;i<l;i++){
		if(ask(s[i])){
			ans=0;flag=false;
		}
		else{
			ans++;
			if(s[i]!=s[i-1]) flag=true;
			if(ans>=3&&flag) printf(" ");
		}
		printf("%c",s[i]);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#define MAXN 3010
using namespace std;
map<char,bool>hash;
char s[MAXN],mid[MAXN];
int ask(char x)
{
	return x=='a'||x=='e'||x=='i'||x=='o'||x=='u';
}
int main(int argc, char const *argv[])
{
	scanf("%s",&s);
	int l=strlen(s);
	int ans=0;bool flag=false;
	if(!ask(s[0])) ans++;printf("%c",s[0]);
	for(int i=1;i<l;i++){
		if(ask(s[i])){
			ans=0;flag=false;
		}
		else{
			ans++;
			if(s[i]!=s[i-1]) flag=true;
			if(ans>=3&&flag){
				printf(" ");
				ans=0;flag=false;
			}
		}
		printf("%c",s[i]);
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define mp make_pair
#define MAX 1000006
#define mod 1000000007
#define pb push_back
#define INF 1e18
#define pii pair<ll,ll>

bool iscons(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u'&&c!=' ')
        return 1;
    return 0;
}
bool notsame(char a,char b,char c)
{
    if(a==b&&a==c)
        return 0;
    return 1;
}
int main()
{
    //freopen ("input1.in","r",stdin);
    //freopen ("output22.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string a,s;
    cin>>a;

    int n=a.size(),i,j;
    s=a+a;
    s[0]=a[0];
    s[1]=a[1];
    j=2;
    for(i=2;i<n;i++)
    {
        if(iscons(s[j-2])&&iscons(s[j-1])&&iscons(a[i])&&notsame(s[j-2],s[j-1],a[i]))
        {
            s[j]=' ';
            j++;
            s[j]=a[i];
            j++;
        }
        else
        {
          s[j]=a[i];
          j++;
        }
    }
    if(s[j-1]==' ')
        j--;
    for(i=0;i<j;i++)
       cout<<s[i];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define mp make_pair
#define MAX 1000006
#define mod 1000000007
#define pb push_back
#define INF 1e18
#define pii pair<ll,ll>

bool iscons(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u'&&c!=' ')
        return 1;
    return 0;
}
bool notsame(char a,char b,char c)
{
    if(a==b&&a==c)
        return 0;
    return 1;
}
int main()
{
    //freopen ("input1.in","r",stdin);
    //freopen ("output22.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string a,s;
    cin>>a;

    int n=a.size(),i,j;
    s=a;
    s[0]=a[0];
    s[1]=a[1];
    j=2;
    for(i=2;i<n;i++)
    {
        if(iscons(s[j-2])&&iscons(s[j-1])&&iscons(a[i])&&notsame(s[j-2],s[j-1],a[i]))
        {
            s[j]=' ';
            j++;
            s[j]=a[i];
            j++;
        }
        else
        {
          s[j]=a[i];
          j++;
        }
    }
    if(s[j-1]==' ')
        j--;
    for(i=0;i<j;i++)
       cout<<s[i];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define mp make_pair
#define MAX 1000006
#define mod 1000000007
#define pb push_back
#define INF 1e18
#define pii pair<ll,ll>

bool iscons(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u'&&c!=' ')
        return 1;
    return 0;
}
bool notsame(char a,char b,char c)
{
    if(a==b&&a==c)
        return 0;
    return 1;
}
int main()
{
    //freopen ("input1.in","r",stdin);
    //freopen ("output22.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string a,s;
    cin>>a;

    int n=a.size(),i,j;
    s=a;
    s[0]=a[0];
    s[1]=a[1];
    j=2;
    for(i=2;i<n;i++)
    {
        if(iscons(s[j-2])&&iscons(s[j-1])&&iscons(a[i])&&notsame(s[j-2],s[j-1],a[i]))
        {
            s[j]='.';
            j++;
            s[j]=a[i];
            j++;
        }
        else
        {
          s[j]=a[i];
          j++;
        }
    }
    if(s[j-1]=='.')
        j--;
    for(i=0;i<j;i++)
    {
        if(s[i]=='.')
            cout<<" ";
        else
            cout<<s[i];
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define mp make_pair
#define MAX 1000006
#define mod 1000000007
#define pb push_back
#define INF 1e18
#define pii pair<ll,ll>

bool iscons(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u'&&c!='.')
        return 1;
    return 0;
}
bool notsame(char a,char b,char c)
{
    if(a==b&&a==c)
        return 0;
    return 1;
}
int main()
{
    //freopen ("input1.in","r",stdin);
    //freopen ("output22.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string a,s;
    cin>>a;

    int n=a.size(),i,j;
    s=a;
    s[0]=a[0];
    s[1]=a[1];
    j=2;
    for(i=2;i<n;i++)
    {
        if(iscons(s[j-2])&&iscons(s[j-1])&&iscons(a[i])&&notsame(s[j-2],s[j-1],a[i]))
        {
            s[j]='.';
            j++;
            s[j]=a[i];
            j++;
        }
        else
        {
          s[j]=a[i];
          j++;
        }
    }
    if(s[j-1]=='.')
        j--;
    s[j]='\0';
    for(i=0;i<j;i++)
    {
        if(s[i]=='.')
            cout<<" ";
        else
            cout<<s[i];
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define mp make_pair
#define MAX 1000006
#define mod 1000000007
#define pb push_back
#define INF 1e18
#define pii pair<ll,ll>

bool iscons(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u'&&c!='.')
        return 1;
    return 0;
}
bool notsame(char a,char b,char c)
{
    if(a==b&&a==c)
        return 0;
    return 1;
}
int main()
{
    //freopen ("input1.in","r",stdin);
    //freopen ("output22.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string a,s;
    cin>>a;

    int n=a.size(),i,j;
    s=a;
    s[0]=a[0];
    s[1]=a[1];
    j=2;
    for(i=2;i<n;i++)
    {
        if(iscons(s[j-2])&&iscons(s[j-1])&&iscons(a[i])&&notsame(s[j-2],s[j-1],a[i]))
        {
            s[j]='.';
            j++;
            s[j]=a[i];
            j++;
        }
        else
        {
          s[j]=a[i];
          j++;
        }
    }
    if(s[j-1]=='.')
        j--;
    for(i=0;i<j;i++)
    {
        if(s[i]=='.')
            cout<<" ";
        else
            cout<<s[i];
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define mp make_pair
#define MAX 100005
#define mod 1000000007
#define pb push_back
#define INF 1e18
#define pii pair<ll,ll>

bool iscons(char c)
{
    if(c!='a'&&c!='e'&&c!='i'&&c!='o'&&c!='u'&&c!=' ')
        return 1;
    return 0;
}
bool notsame(char a,char b,char c)
{
    if(a==b&&a==c)
        return 0;
    return 1;
}
int main()
{
    //freopen ("input1.in","r",stdin);
    //freopen ("output22.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string a,s;
    cin>>a;

    int n=a.size(),i,j=1;
    s=a+a;
    s[0]=a[0];
    if(n>1)
    {
        s[1]=a[1];
        j=2;
    }
    for(i=2;i<n;i++)
    {
        if(iscons(s[j-2])&&iscons(s[j-1])&&iscons(a[i])&&notsame(s[j-2],s[j-1],a[i]))
        {
            s[j]=' ';
            j++;
            s[j]=a[i];
            j++;
        }
        else
        {
          s[j]=a[i];
          j++;
        }
    }
    if(s[j-1]==' ')
        j--;
    for(i=0;i<j;i++)
       cout<<s[i];
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const string vow="aeiou ";

string s;

bool isVow(char c) {
	for (int i=0; i<vow.length(); i++) {
		if (c==vow[i]) {
			return true;
		}
	}
	return false;
}

int main() {
	//freopen("input.txt","r",stdin);
	cin>>s;
	if (s.length()<3) {
		cout<<s<<endl;
		return 0;
	}
	cout<<s[0]<<s[1];
	char x=s[0], y=s[1];
	for (int i=2; i<s.length(); i++) {
		if (!isVow(s[i]) && !isVow(x) && !isVow(y)) {
			if (s[i]!=y || y!=x) {
				cout<<' ';
				x=y;
				y=' ';
			}
		}
		cout<<s[i];
		x=y;
		y=s[i];
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const string vow="aeiou";

string s;

bool isVow(char c) {
	for (int i=0; i<vow.length(); i++) {
		if (c==vow[i]) {
			return true;
		}
	}
	return false;
}

int main() {
	//freopen("input.txt","r",stdin);
	cin>>s;
	cout<<s[0]<<s[1];
	for (int i=2; i<s.length(); i++) {
		if (!isVow(s[i]) && !isVow(s[i-1]) && !isVow(s[i-2])) {
			if (s[i]!=s[i-1] || s[i-1]!=s[i-2]) {
				cout<<' ';
			}
		}
		cout<<s[i];
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const string vow="aeiou ";

string s;

bool isVow(char c) {
	for (int i=0; i<vow.length(); i++) {
		if (c==vow[i]) {
			return true;
		}
	}
	return false;
}

int main() {
	//freopen("input.txt","r",stdin);
	cin>>s;
	cout<<s[0]<<s[1];
	char x=s[0], y=s[1];
	for (int i=2; i<s.length(); i++) {
		if (!isVow(s[i]) && !isVow(x) && !isVow(y)) {
			if (s[i]!=y || y!=x) {
				cout<<' ';
				x=y;
				y=' ';
			}
		}
		cout<<s[i];
		x=y;
		y=s[i];
	}
	return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
	string st;
	cin>>st;
	int temp=0 ;
	char num[3];
	for(int i=0 ; i<st.size() ; i++){
		//cerr<<temp<<" ";
		if(st[i]=='e' || st[i]=='a' || st[i]=='i' || st[i]=='u' || st[i]=='o'){
			temp=0;
		}else{
			num[temp]=st[i];
			temp++;
		}
		if(temp==3){
			int Max =max(num[0],max(num[1],num[2]));
			int Min =min(num[0],min(num[1],num[2]));
			if(Min!=Max){
				cout<<" ";
				temp=1;
			}else
				temp=2;
		}
		cout<<st[i];
	}

}


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	string st;
	cin>>st;
	int temp=0 ;
	char num[3];
	for(int i=0 ; i<st.size() ; i++){
		//cerr<<temp<<" ";
		if(st[i]=='e' || st[i]=='a' || st[i]=='i' || st[i]=='u' || st[i]=='o'){
			temp=0;
		}else{
			num[temp]=st[i];
			temp++;
		}
		if(temp==3){
			int Max =max(num[0],max(num[1],num[2]));
			int Min =min(num[0],min(num[1],num[2]));
			if(Min!=Max){
				cout<<" ";
				temp=1;
				num[0]=num[2];
			}else
				temp=2;
		}
		cout<<st[i];
	}

}


#include<bits/stdc++.h>

using namespace std;

bool cons(char c) {

    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return false;
    return true;

}

int main(){

    string s;
    cin >> s;
    int len,i;
    len = s.length();
    cout << s[0];
    if(len > 1) cout << s[1];
    for(i=2;i<len;i++) {
        if(s[i] == s[i - 1] && s[i - 1] == s[i - 2]) {
            cout << s[i];
        }
        else {
            if(cons(s[i]) && cons(s[i - 1]) && cons(s[i - 2])) {
                cout << " ";
                cout << s[i];
                if(i + 1 < len) cout << s[i + 1]; i = i + 1;
            }
            else {
                cout << s[i];
            }
        }
    }
    return 0;

}


#include <bits/stdc++.h>

using namespace std;
bool conso(char c)
{
    return !(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c==' ');
}
bool not_same(char a, char b, char c)
{
    return !(a==b && b==c);
}
int main()
{
    string s;
    cin>>s;
    cout<<s[0]<<s[1];
    for(int i=2; i<s.length(); i++)
    {
        if(conso(s[i-2]) && conso(s[i-1]) && conso(s[i]) && not_same(s[i],s[i-1],s[i-2]))
        {
            cout<<" "<<s[i];
            s[i-1]=' ';
        }
        else
            cout<<s[i];
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool conso(char c)
{
    return !(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c==' ');
}
bool not_same(char a, char b, char c)
{
    return !(a==b && b==c);
}
int main()
{
    string s;
    cin>>s;
    if(s.length()==1)
        cout<<s[0];
    else
        cout<<s[0]<<s[1];
    for(int i=2; i<s.length(); i++)
    {
        if(conso(s[i-2]) && conso(s[i-1]) && conso(s[i]) && not_same(s[i],s[i-1],s[i-2]))
        {
            cout<<" "<<s[i];
            s[i-1]=' ';
        }
        else
            cout<<s[i];
    }
    return 0;
}


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

const int N=105;

int n,m,x,y;
vector<int>q[N];
set<int>g;

inline bool check(int x){
    for(int i=1,j=x;i<=100;i++,j+=x){
        for(auto it:q[i]){
            if((it+x-1)/x!=i){
                return false;
            }
        }
    }
    return true;
}

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        cin>>x>>y;
        if(x==n){
            return cout<<y,0;
        }
        q[y].push_back(x);
    }
    /// kolvo kvartir
    for(int i=1;i<=100;i++){
        if(!check(i)){
            continue;
        }
        g.insert(i);
    }
    if(g.size()!=1){
        return cout<<"-1",0;
    }
    int x=*g.begin();
    cout<<(n+x-1)/x;
}


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

string s,t;
map<char,bool>good;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>s;
    good['a']=good['e']=good['i']=good['o']=good['u']=true;
    vector<char>q;
    for(int i=0;i<s.size();i++){
        if(!good[s[i]]){
            if(q.size()<=1){

            }
            else if(q.size()>=2 && q.back()==s[i] && q[q.size()-2]==s[i]){

            }
            else{
                q.clear();
                t+=' ';
            }
            q.push_back(s[i]);
        }
        else{
            q.clear();
        }
        t+=s[i];
    }
    cout<<t;
}


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

const int N=3005;

string s;
pair<int,int>dp[N];
bool good[N][N];
vector<string>ans;
bool bad[N];

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>s;
    bad['a']=bad['e']=bad['i']=bad['o']=bad['u']=true;
    int n=s.size();
    s='#'+s;
    memset(good,1,sizeof(good));
    for(int i=1;i<=n;i++){
        int cur=0;
        for(int j=i;j<=n;j++){
            if(!good[i][j-1]){
                good[i][j]=false;
            }
            if(!bad[s[j]]){
                if(cur==2){
                    if(s[j]!=s[j-1] || s[j]!=s[j-2]){
                        good[i][j]=false;
                    }
                }
                cur++;
            }
            else{
                cur=0;
            }
        }
    }
    /**for(int i=1;i<=n;i++){
        for(int j=i;j<=n;j++){
            cout<<i<<" "<<j<<" "<<good[i][j]<<"\n";
        }
    }exit(0);*/
    memset(dp,63,sizeof(dp));
    dp[0]=make_pair(0,0);
    for(int i=1;i<=n;i++){
        for(int j=i-1;j>=0;j--){
            if(good[j+1][i]){
                dp[i]=min(dp[i],make_pair(dp[j].first+1,j));
            }
        }
    }
    //for(int i=1;i<=n;i++){cout<<dp[i].first<<" "<<dp[i].second<<"\n";}
    int cur=n;
    while(cur!=0){
        ans.push_back(s.substr(dp[cur].second+1,cur-dp[cur].second));
        cur=dp[cur].second;
    }
    for(int i=ans.size()-1;i>=0;i--){
        cout<<ans[i]<<" ";
    }
}


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

const int N=3005;

string s;
pair<int,int>dp[N];
bool good[N][N];
vector<string>ans;
bool bad[N];

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>s;
    bad['a']=bad['e']=bad['i']=bad['o']=bad['u']=true;
    int n=s.size();
    s='#'+s;
    memset(good,1,sizeof(good));
    for(int i=1;i<=n;i++){
        int cur=0;
        for(int j=i;j<=n;j++){
            if(!good[i][j-1]){
                good[i][j]=false;
            }
            if(!bad[s[j]]){
                if(cur>=2){
                    if(s[j]!=s[j-1] || s[j]!=s[j-2]){
                        good[i][j]=false;
                    }
                }
                cur++;
            }
            else{
                cur=0;
            }
        }
    }
    /**for(int i=1;i<=n;i++){
        for(int j=i;j<=n;j++){
            cout<<i<<" "<<j<<" "<<good[i][j]<<"\n";
        }
    }exit(0);*/
    memset(dp,63,sizeof(dp));
    dp[0]=make_pair(0,0);
    for(int i=1;i<=n;i++){
        for(int j=i-1;j>=0;j--){
            if(good[j+1][i]){
                dp[i]=min(dp[i],make_pair(dp[j].first+1,j));
            }
        }
    }
    //for(int i=1;i<=n;i++){cout<<dp[i].first<<" "<<dp[i].second<<"\n";}
    int cur=n;
    while(cur!=0){
        ans.push_back(s.substr(dp[cur].second+1,cur-dp[cur].second));
        cur=dp[cur].second;
    }
    for(int i=ans.size()-1;i>=0;i--){
        cout<<ans[i]<<" ";
    }
}


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

#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define INF 1000000000007

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

//     long long power(long long x, long long y, long long p)
// {
//     long long res = 1;

//     x = x % p;

//     while (y > 0)
//     {

//         if (y & 1)
//             res = (res*x) % p;

//         y = y>>1;
//         x = (x*x) % p;
//     }
//     return res;
// }

// long long modInverse(long long n, long long p)
// {
//     return power(n, p-2, p);
// }

// long long ncrp(long long n, long long r, long long p)
// {

//    if (r==0)
//       return 1;

//     long long fac[n+1];
//     fac[0] = 1;
//     // for (long long i=1 ; i<=n; i++)
//     //     fac[i] = fac[i-1]*i%p;

//     return (fac[n]* modInverse(fac[r], p) % p *
//             modInverse(fac[n-r], p) % p) % p;
// }

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }

    string t;
    cin >> t;

    set<char> s;
    s.insert('a');
    s.insert('e');
    s.insert('i');
    s.insert('o');
    s.insert('u');

    ll i;
    ll cc=0;

    string res="";

    ll n=t.length();

    for(i=0;i<n;i++)
    {
        if(s.find(t[i])!=s.end())
        {
            // res+=t[i];
            cout<<t[i];
            cc=0;

        }
        else{
            // cout<<t[i]<<" ";
            cc++;
            if(cc==3)
            {
                // res+='';
                cout<<" ";
                cc=1;
            }
            // res+=t[i];
            cout<<t[i];

        }
    }

    cout<<res<<endl;

    return 0;
}


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

#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define INF 1000000000007

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

//     long long power(long long x, long long y, long long p)
// {
//     long long res = 1;

//     x = x % p;

//     while (y > 0)
//     {

//         if (y & 1)
//             res = (res*x) % p;

//         y = y>>1;
//         x = (x*x) % p;
//     }
//     return res;
// }

// long long modInverse(long long n, long long p)
// {
//     return power(n, p-2, p);
// }

// long long ncrp(long long n, long long r, long long p)
// {

//    if (r==0)
//       return 1;

//     long long fac[n+1];
//     fac[0] = 1;
//     // for (long long i=1 ; i<=n; i++)
//     //     fac[i] = fac[i-1]*i%p;

//     return (fac[n]* modInverse(fac[r], p) % p *
//             modInverse(fac[n-r], p) % p) % p;
// }

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }

    string t;
    cin >> t;

    set<char> s,p;
    s.insert('a');
    s.insert('e');
    s.insert('i');
    s.insert('o');
    s.insert('u');

    ll i;
    ll cc=0;

    string res="";

    ll n=t.length();

    for(i=0;i<n;i++)
    {
        p.insert(t[i]);

    }

    if(p.size()==1)
    {
        cout<<t<<endl;
        return 0;
    }

    for(i=0;i<n;i++)
    {
        if(s.find(t[i])!=s.end())
        {
            // res+=t[i];
            cout<<t[i];
            cc=0;

        }
        else{
            // cout<<t[i]<<" ";
            cc++;
            if(cc==3)
            {
                // res+='';
                if(t[i]!=t[i-1]||t[i]!=t[i-2]||t[i-1]!=t[i-2])
                {
                cout<<" ";
                }
                cc=1;
            }
            // res+=t[i];
            cout<<t[i];

        }
    }

    cout<<res<<endl;

    return 0;
}


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

#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define INF 1000000000007

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

//     long long power(long long x, long long y, long long p)
// {
//     long long res = 1;

//     x = x % p;

//     while (y > 0)
//     {

//         if (y & 1)
//             res = (res*x) % p;

//         y = y>>1;
//         x = (x*x) % p;
//     }
//     return res;
// }

// long long modInverse(long long n, long long p)
// {
//     return power(n, p-2, p);
// }

// long long ncrp(long long n, long long r, long long p)
// {

//    if (r==0)
//       return 1;

//     long long fac[n+1];
//     fac[0] = 1;
//     // for (long long i=1 ; i<=n; i++)
//     //     fac[i] = fac[i-1]*i%p;

//     return (fac[n]* modInverse(fac[r], p) % p *
//             modInverse(fac[n-r], p) % p) % p;
// }

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }

    string t;
    cin >> t;

    set<char> s,p;
    s.insert('a');
    s.insert('e');
    s.insert('i');
    s.insert('o');
    s.insert('u');

    ll i;
    ll cc=0;

    string res="";

    ll n=t.length();

    for(i=0;i<n;i++)
    {
        p.insert(t[i]);

    }

    if(p.size()==1)
    {
        cout<<t<<endl;
        return 0;
    }

    for(i=0;i<n;i++)
    {
        if(s.find(t[i])!=s.end())
        {
            // res+=t[i];
            cout<<t[i];
            cc=0;

        }
        else{
            // cout<<t[i]<<" ";
            cc++;
            if(cc==3)
            {
                // res+='';
                cc=1;
                if(t[i]!=t[i-1]||t[i]!=t[i-2]||t[i-1]!=t[i-2])
                {
                cout<<" ";

                }

                if(t[i]==t[i-1]&&t[i-1]==t[i-2]&&t[i]==t[i-1])
                {
                    cc=2;
                }

            }
            // res+=t[i];
            cout<<t[i];

        }
    }

    cout<<res<<endl;

    return 0;
}


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

#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define INF 1000000000007

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

//     long long power(long long x, long long y, long long p)
// {
//     long long res = 1;

//     x = x % p;

//     while (y > 0)
//     {

//         if (y & 1)
//             res = (res*x) % p;

//         y = y>>1;
//         x = (x*x) % p;
//     }
//     return res;
// }

// long long modInverse(long long n, long long p)
// {
//     return power(n, p-2, p);
// }

// long long ncrp(long long n, long long r, long long p)
// {

//    if (r==0)
//       return 1;

//     long long fac[n+1];
//     fac[0] = 1;
//     // for (long long i=1 ; i<=n; i++)
//     //     fac[i] = fac[i-1]*i%p;

//     return (fac[n]* modInverse(fac[r], p) % p *
//             modInverse(fac[n-r], p) % p) % p;
// }

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }

    string t;
    cin >> t;

    set<char> s,p;
    s.insert('a');
    s.insert('e');
    s.insert('i');
    s.insert('o');
    s.insert('u');

    ll i;
    ll cc=0;

    string res="";

    ll n=t.length();

    for(i=0;i<n;i++)
    {
        p.insert(t[i]);

    }

    if(p.size()==1)
    {
        cout<<t<<endl;
        return 0;
    }

    for(i=0;i<n;i++)
    {
        if(s.find(t[i])!=s.end())
        {
            // res+=t[i];
            cout<<t[i];
            cc=0;

        }
        else{
            // cout<<t[i]<<" ";
            cc++;
            if(cc==3)
            {
                // res+='';
                if(t[i]!=t[i-1]||t[i]!=t[i-2]||t[i-1]!=t[i-1])
                {
                cout<<" ";
                }
                cc=1;
            }
            // res+=t[i];
            cout<<t[i];

        }
    }

    cout<<res<<endl;

    return 0;
}


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

#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define INF 1000000000007

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

//     long long power(long long x, long long y, long long p)
// {
//     long long res = 1;

//     x = x % p;

//     while (y > 0)
//     {

//         if (y & 1)
//             res = (res*x) % p;

//         y = y>>1;
//         x = (x*x) % p;
//     }
//     return res;
// }

// long long modInverse(long long n, long long p)
// {
//     return power(n, p-2, p);
// }

// long long ncrp(long long n, long long r, long long p)
// {

//    if (r==0)
//       return 1;

//     long long fac[n+1];
//     fac[0] = 1;
//     // for (long long i=1 ; i<=n; i++)
//     //     fac[i] = fac[i-1]*i%p;

//     return (fac[n]* modInverse(fac[r], p) % p *
//             modInverse(fac[n-r], p) % p) % p;
// }

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }

    string t;
    cin >> t;

    set<char> s,p;
    s.insert('a');
    s.insert('e');
    s.insert('i');
    s.insert('o');
    s.insert('u');

    ll i;
    ll cc=0;

    string res="";

    ll n=t.length();

    for(i=0;i<n;i++)
    {
        p.insert(t[i]);

    }

    if(p.size()==1)
    {
        cout<<t<<endl;
        return 0;
    }

    for(i=0;i<n;i++)
    {
        if(s.find(t[i])!=s.end())
        {
            // res+=t[i];
            cout<<t[i];
            cc=0;

        }
        else{
            // cout<<t[i]<<" ";
            cc++;
            if(cc==3)
            {
                // res+='';
                cout<<" ";
                cc=1;
            }
            // res+=t[i];
            cout<<t[i];

        }
    }

    cout<<res<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<ll> vi;
int main(){
	ios_base::sync_with_stdio(false);
	string s;cin>>s;
	ll n=s.size();
	vi v(26,0);
	v['a'-'a']=1;v['e'-'a']=1;v['i'-'a']=1;v['o'-'a']=1;v['u'-'a']=1;
	if(n<=2){
		cout<<s<<endl;
		return 0;
	}
	set<char> p;
	string ans="";
	for(ll i=0;i<n;){
		//cout<<i<<endl;
		if(v[s[i]-'a']==1){
			ans=ans+s[i];
			i++;
			continue;
		}
		else{
			//cout<<"UES"<<endl;
			ll j;
			for(j=i;j<n;j++){
				if(v[s[j]-'a']==0)
					p.insert(s[j]);
				else
					break;
			}
			//cout<<p.size()<<endl;
			if(p.size()==1 || j-i<=2){
				for(ll k=i;k<j;k++)
					ans=ans+s[k];
				i=j;
				continue;
			}
			else{
				while(i!=j){
					if(i+2<=j){
						for(ll k=i;k<i+2;k++)
							ans=ans+s[k];
						i=i+2;
						if(i==j)
							continue;
						ll o=2;
						if(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
							while(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
								ans=ans+s[i];
								i++;
								o++;
							}
							//cout<<o<<endl;
						}
						if(o>3)
							continue;
						cout<<ans<<" ";
						ans="";
					}
					else{
						ans=ans+s[i];
						i++;
					}
				}
			}
			p.clear();
			i=j;
		}
	}
	cout<<ans<<" " ;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<ll> vi;
int main(){
	ios_base::sync_with_stdio(false);
	string s;cin>>s;
	ll n=s.size();
	vi v(26,0);
	v['a'-'a']=1;v['e'-'a']=1;v['i'-'a']=1;v['o'-'a']=1;v['u'-'a']=1;
	if(n<=2){
		cout<<s<<endl;
		return 0;
	}
	set<char> p;
	string ans="";
	for(ll i=0;i<n;){
		//cout<<i<<endl;
		if(v[s[i]-'a']==1){
			ans=ans+s[i];
			i++;
			continue;
		}
		else{
			//cout<<"UES"<<endl;
			ll j;
			for(j=i;j<n;j++){
				if(v[s[j]-'a']==0)
					p.insert(s[j]);
				else
					break;
			}
			//cout<<p.size()<<endl;
			if(p.size()==1 || j-i<=2){
				for(ll k=i;k<j;k++)
					ans=ans+s[k];
				i=j;
				continue;
			}
			else{
				while(i!=j){
					if(i+2<=j){
						for(ll k=i;k<i+2;k++)
							ans=ans+s[k];
						i=i+2;
						if(i==j)
							continue;
						ll o=2;
						if(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
							while(ans[ans.size()-1]==s[i] && i<j){
								ans=ans+s[i];
								i++;
								o++;
							}
							//cout<<o<<endl;
						}
						if(o>3 && i==j)
							continue;
						cout<<ans<<" ";
						ans="";
					}
					else{
						ans=ans+s[i];
						i++;
					}
				}
			}
			p.clear();
			i=j;
		}
	}
	if(ans.size()>0)
		cout<<ans<<" " ;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<ll> vi;
int main(){
	ios_base::sync_with_stdio(false);
	string s;cin>>s;
	ll n=s.size();
	vi v(26,0);
	v['a'-'a']=1;v['e'-'a']=1;v['i'-'a']=1;v['o'-'a']=1;v['u'-'a']=1;
	if(n<=2){
		cout<<s<<endl;
		return 0;
	}
	set<char> p;
	string ans="";
	for(ll i=0;i<n;){
		//cout<<i<<endl;
		if(v[s[i]-'a']==1){
			ans=ans+s[i];
			i++;
			continue;
		}
		else{
			//cout<<"UES"<<endl;
			ll j;
			for(j=i;j<n;j++){
				if(v[s[j]-'a']==0)
					p.insert(s[j]);
				else
					break;
			}
			//cout<<p.size()<<endl;
			if(p.size()==1 || j-i<=2){
				for(ll k=i;k<j;k++)
					ans=ans+s[k];
				i=j;
				continue;
			}
			else{
				while(i!=j){
					if(i+2<=j){
						for(ll k=i;k<i+2;k++)
							ans=ans+s[k];
						i=i+2;
						while(ans[ans.size()-1]==s[i] && i<j){
							//cout<<i<<endl;
							//cout<<ans<<endl;
							ans=ans+s[i];
							i++;
						}
						cout<<ans<<" ";
						ans="";
					}
					else{
						ans=ans+s[i];
						i++;
					}
				}
			}
			p.clear();
			i=j;
		}
	}
	cout<<ans<<" " ;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<ll> vi;
int main(){
	ios_base::sync_with_stdio(false);
	string s;cin >> s;
	int n = s.size();
	int k = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u') {
			k = 0;
			cout << s[i];
			continue;
		}
		if (i > 0 && s[i] == s[i - 1]) {
			if (k == 1) {
				k = 2;
				cout << s[i];
				continue;
			}
			if (k == 2) {
				cout << s[i];
				continue;
			}
			else {
				cout << ' ' << s[i];
				k = 1;
				continue;
			}
		}
		if (k == 0) {
			k = 1;
			cout << s[i];
			continue;
		}
		if (k == 1) {
			cout << s[i];
			k = 3;
			continue;
		}
		cout << ' ' << s[i];
		k = 1;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<ll> vi;
int main(){
	ios_base::sync_with_stdio(false);
	string s;cin>>s;
	ll n=s.size();
	vi v(26,0);
	v['a'-'a']=1;v['e'-'a']=1;v['i'-'a']=1;v['o'-'a']=1;v['u'-'a']=1;
	if(n<=2){
		cout<<s<<endl;
		return 0;
	}
	set<char> p;
	string ans="";
	for(ll i=0;i<n;){
		//cout<<i<<endl;
		if(v[s[i]-'a']==1){
			ans=ans+s[i];
			i++;
			continue;
		}
		else{
			//cout<<"UES"<<endl;
			ll j;
			for(j=i;j<n;j++){
				if(v[s[j]-'a']==0)
					p.insert(s[j]);
				else
					break;
			}
			//cout<<p.size()<<endl;
			if(p.size()==1 || j-i<=2){
				for(ll k=i;k<j;k++)
					ans=ans+s[k];
				i=j;
				continue;
			}
			else{
				while(i!=j){
					if(i+2<=j){
						for(ll k=i;k<i+2;k++)
							ans=ans+s[k];
						i=i+2;
						if(i==j)
							continue;
						if(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
							while(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
								ans=ans+s[i];
								i++;
							}
							if(i<j){
								ans=ans+s[i];
								i++;
							}
						}
						cout<<ans<<" ";
						ans="";
					}
					else{
						ans=ans+s[i];
						i++;
					}
				}
			}
			p.clear();
			i=j;
		}
	}
	cout<<ans<<" " ;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<ll> vi;
int main(){
	ios_base::sync_with_stdio(false);
	string s;cin>>s;
	ll n=s.size();
	vi v(26,0);
	v['a'-'a']=1;v['e'-'a']=1;v['i'-'a']=1;v['o'-'a']=1;v['u'-'a']=1;
	if(n<=2){
		cout<<s<<endl;
		return 0;
	}
	set<char> p;
	string ans="";
	for(ll i=0;i<n;){
		//cout<<i<<endl;
		if(v[s[i]-'a']==1){
			ans=ans+s[i];
			i++;
			continue;
		}
		else{
			//cout<<"UES"<<endl;
			ll j;
			for(j=i;j<n;j++){
				if(v[s[j]-'a']==0)
					p.insert(s[j]);
				else
					break;
			}
			//cout<<p.size()<<endl;
			if(p.size()==1 || j-i<=2){
				for(ll k=i;k<j;k++)
					ans=ans+s[k];
				i=j;
				continue;
			}
			else{
				while(i!=j){
					if(i+2<=j){
						for(ll k=i;k<i+2;k++)
							ans=ans+s[k];
						i=i+2;
						while(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
							//cout<<i<<endl;
							//cout<<ans<<endl;
							ans=ans+s[i];
							i++;
						}
						cout<<ans<<" ";
						ans="";
					}
					else{
						ans=ans+s[i];
						i++;
					}
				}
			}
			p.clear();
			i=j;
		}
	}
	cout<<ans<<" " ;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<ll> vi;
int main(){
	ios_base::sync_with_stdio(false);
	string s;cin>>s;
	ll n=s.size();
	vi v(26,0);
	v['a'-'a']=1;v['e'-'a']=1;v['i'-'a']=1;v['o'-'a']=1;v['u'-'a']=1;
	if(n<=2){
		cout<<s<<endl;
		return 0;
	}
	set<char> p;
	string ans="";
	for(ll i=0;i<n;){
		//cout<<i<<endl;
		if(v[s[i]-'a']==1){
			ans=ans+s[i];
			i++;
			continue;
		}
		else{
			//cout<<"UES"<<endl;
			ll j;
			for(j=i;j<n;j++){
				if(v[s[j]-'a']==0)
					p.insert(s[j]);
				else
					break;
			}
			//cout<<p.size()<<endl;
			if(p.size()==1 || j-i<=2){
				for(ll k=i;k<j;k++)
					ans=ans+s[k];
				i=j;
				continue;
			}
			else{
				while(i!=j){
					if(i+2<=j){
						for(ll k=i;k<i+2;k++)
							ans=ans+s[k];
						i=i+2;
						if(i==j)
							continue;
						while(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
							//cout<<i<<endl;
							//cout<<ans<<endl;
							ans=ans+s[i];
							i++;
						}
						cout<<ans<<" ";
						ans="";
					}
					else{
						ans=ans+s[i];
						i++;
					}
				}
			}
			p.clear();
			i=j;
		}
	}
	cout<<ans<<" " ;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef vector<ll> vi;
int main(){
	ios_base::sync_with_stdio(false);
	string s;cin>>s;
	ll n=s.size();
	vi v(26,0);
	v['a'-'a']=1;v['e'-'a']=1;v['i'-'a']=1;v['o'-'a']=1;v['u'-'a']=1;
	if(n<=2){
		cout<<s<<endl;
		return 0;
	}
	set<char> p;
	string ans="";
	for(ll i=0;i<n;){
		//cout<<i<<endl;
		if(v[s[i]-'a']==1){
			ans=ans+s[i];
			i++;
			continue;
		}
		else{
			//cout<<"UES"<<endl;
			ll j;
			for(j=i;j<n;j++){
				if(v[s[j]-'a']==0)
					p.insert(s[j]);
				else
					break;
			}
			//cout<<p.size()<<endl;
			if(p.size()==1 || j-i<=2){
				for(ll k=i;k<j;k++)
					ans=ans+s[k];
				i=j;
				continue;
			}
			else{
				while(i!=j){
					if(i+2<=j){
						for(ll k=i;k<i+2;k++)
							ans=ans+s[k];
						i=i+2;
						if(i==j)
							continue;
						ll o=2;
						if(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
							while(ans[ans.size()-1]==s[i] && ans[ans.size()-2]==s[i] && i<j){
								ans=ans+s[i];
								i++;
								o++;
							}
							//cout<<o<<endl;
						}
						if(o>3 && i==j)
							continue;
						cout<<ans<<" ";
						ans="";
					}
					else{
						ans=ans+s[i];
						i++;
					}
				}
			}
			p.clear();
			i=j;
		}
	}
	cout<<ans<<" " ;
	return 0;
}


//
//  main.cpp
//  C. Возможно, вы имели в виду...
//
//  Created by Андрей Москалёв on 17.09.17.
//  Copyright © 2017 Андрей Москалёв. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <ctime>

typedef long long ll;

using namespace std;

string s;

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

ll getfirsterror() {
    for (int i = 2; i < s.size(); ++i) {
        if (e(s[i]) && e(s[i - 1]) && e(s[i - 2]) && s[i] != s[i - 1] && s[i] != s[i - 2]) {
            return i;
        }
    }
    return -1;
}

int main(int argc, const char * argv[]) {
    cin >> s;
    ll err = getfirsterror(), last = err;
    while (err != -1) {
        s.insert(err, " ");
        last = err;
        err = getfirsterror();
    }
    cout << s;
    return 0;
}


//
//  main.cpp
//  C. Возможно, вы имели в виду...
//
//  Created by Андрей Москалёв on 17.09.17.
//  Copyright © 2017 Андрей Москалёв. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <ctime>

typedef long long ll;

using namespace std;

string s;

ll pos = -1;

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

ll getfirsterror() {
    for (int i = pos; i + 2 < s.size(); ++i) {
        set<char> ss;
        ss.insert(s[i]);
        ss.insert(s[i + 1]);
        ss.insert(s[i + 2]);
        if (!gl(s[i]) && !gl(s[i + 1]) && !gl(s[i + 2]) && ss.size() != 1) {
            return i;
        }
    }
    return -1;
}

int main(int argc, const char * argv[]) {
    cin >> s;
    ll id = getfirsterror();
    while (id != -1) {
        s.insert(id + 2, " ");
        pos = id;
        id = getfirsterror();
    }
    cout << s;
    return 0;
}


//
//  main.cpp
//  C. Возможно, вы имели в виду...
//
//  Created by Андрей Москалёв on 17.09.17.
//  Copyright © 2017 Андрей Москалёв. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <ctime>

typedef long long ll;

using namespace std;

string s;

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

ll getfirsterror() {
    for (int i = 0; i + 2 < s.size(); ++i) {
        set<char> ss;
        ss.insert(s[i]);
        ss.insert(s[i + 1]);
        ss.insert(s[i + 2]);
        if (!gl(s[i]) && !gl(s[i + 1]) && !gl(s[i + 2]) && ss.size() != 1) {
            return i;
        }
    }
    return -1;
}

int main(int argc, const char * argv[]) {
    cin >> s;
    ll id = getfirsterror();
    while (id != -1) {
        s.insert(id + 2, " ");
        id = getfirsterror();
    }
    cout << s;
    return 0;
}


//
//  main.cpp
//  C. Возможно, вы имели в виду...
//
//  Created by Андрей Москалёв on 17.09.17.
//  Copyright © 2017 Андрей Москалёв. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <ctime>

typedef long long ll;

using namespace std;

string s;

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

ll getfirsterror() {
    for (int i = 3; i < s.size(); ++i) {
        if (e(s[i]) && e(s[i - 1]) && e(s[i - 2]) && s[i] != s[i - 1] && s[i] != s[i - 2]) {
            return i;
        }
    }
    return -1;
}

int main(int argc, const char * argv[]) {
    cin >> s;
    ll err = getfirsterror(), last = err;
    while (err != -1) {
        s.insert(err, " ");
        last = err;
        err = getfirsterror();
    }
    cout << s;
    return 0;
}


//
//  main.cpp
//  C. Возможно, вы имели в виду...
//
//  Created by Андрей Москалёв on 17.09.17.
//  Copyright © 2017 Андрей Москалёв. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <ctime>

typedef long long ll;

using namespace std;

string s;

int pos = -1;

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

ll getfirsterror() {
    for (int i = pos; i + 2 < s.size(); ++i) {
        set<char> ss;
        ss.insert(s[i]);
        ss.insert(s[i + 1]);
        ss.insert(s[i + 2]);
        if (!gl(s[i]) && !gl(s[i + 1]) && !gl(s[i + 2]) && ss.size() != 1) {
            pos = i + 1;
            return i;
        }
    }
    return -1;
}

int main(int argc, const char * argv[]) {
    cin >> s;
    ll id = getfirsterror();
    while (id != -1) {
        s.insert(id + 2, " ");
        id = getfirsterror();
    }
    cout << s;
    return 0;
}


//
//  main.cpp
//  C. Возможно, вы имели в виду...
//
//  Created by Андрей Москалёв on 17.09.17.
//  Copyright © 2017 Андрей Москалёв. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <ctime>

typedef long long ll;

using namespace std;

string s;

int pos = 0;

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

ll getfirsterror() {
    for (int i = pos; i + 2 < s.size(); ++i) {
        set<char> ss;
        ss.insert(s[i]);
        ss.insert(s[i + 1]);
        ss.insert(s[i + 2]);
        if (!gl(s[i]) && !gl(s[i + 1]) && !gl(s[i + 2]) && ss.size() != 1) {
            pos = i;
            return i;
        }
    }
    return -1;
}

int main(int argc, const char * argv[]) {
    cin >> s;
    ll id = getfirsterror();
    while (id != -1) {
        s.insert(id + 2, " ");
        id = getfirsterror();
    }
    cout << s;
    return 0;
}


//
//  main.cpp
//  C. Возможно, вы имели в виду...
//
//  Created by Андрей Москалёв on 17.09.17.
//  Copyright © 2017 Андрей Москалёв. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <ctime>

typedef long long ll;

using namespace std;

string s;

int pos = -1;

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

ll getfirsterror() {
    for (int i = pos - 1; i + 2 < s.size(); ++i) {
        set<char> ss;
        ss.insert(s[i]);
        ss.insert(s[i + 1]);
        ss.insert(s[i + 2]);
        if (!gl(s[i]) && !gl(s[i + 1]) && !gl(s[i + 2]) && ss.size() != 1) {
            return i;
        }
    }
    return -1;
}

int main(int argc, const char * argv[]) {
    cin >> s;
    ll id = getfirsterror();
    while (id != -1) {
        s.insert(id + 2, " ");
        pos = id;
        id = getfirsterror();
    }
    cout << s;
    return 0;
}


#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <iterator>
#include <string>
#include <queue>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define PI acos(-1)
typedef long long ll;
typedef long double ld;

using namespace std;

    string s;
    string s1="aeuio";
    int dl, kol, pr;
    char c;

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0);

    cin >> s;
    dl=s.length();
    c=s[0];
        for (int i=0; i<dl; i++){
            if (s[i]==c){
                while (s[i]==c){
                    cout << s[i];
                    i++, kol++;
                }
                if (kol>2) kol=0;
            }
            if (find(s1.begin(), s1.end(), s[i])==s1.end())
                kol++, c=s[i];
            if (find(s1.begin(), s1.end(), s[i])!=s1.end())
                kol=0, c=s[i];
            if (kol==3){
                cout << " ";
                kol=1;
            }
            cout << s[i];
        }
    return 0;
}


#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <iterator>
#include <string>
#include <queue>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define PI acos(-1)
typedef long long ll;
typedef long double ld;

using namespace std;

    string s;
    string s1="aeuio";
    int dl, kol;
    char c;

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0);

    cin >> s;
    dl=s.length();
    c=s[0];
        for (int i=0; i<dl; i++){
            if (find(s1.begin(), s1.end(), s[i])==s1.end() && s[i]!=c)
                kol++, c=s[i];
            if (find(s1.begin(), s1.end(), s[i])!=s1.end())
                kol=0;
            if (kol==3){
                cout << " ";
                kol=0;
            }
            cout << s[i];
        }
    return 0;
}


#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <iterator>
#include <string>
#include <queue>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define PI acos(-1)
typedef long long ll;
typedef long double ld;

using namespace std;

    string s;
    string s1="aeuio";
    int dl, kol;
    char c;

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0);

    cin >> s;
    dl=s.length();
    c=s[0];
        for (int i=0; i<dl; i++){
            if (s[i]==s[i-1] && s[i]==s[i-2])
                kol=0;
            if (find(s1.begin(), s1.end(), s[i])==s1.end())
                kol++, c=s[i];
            if (find(s1.begin(), s1.end(), s[i])!=s1.end())
                kol=0;
            if (kol>=3){
                cout << " ";
                kol=0;
            }
            cout << s[i];
        }
    return 0;
}


#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

    int n, schet;
    string s;
    vector <char> ans;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0);

    cin >> s;
    n=s.length();
        for (int i=0; i<n; i++){
            if (s[i]=='o' || s[i]=='i' || s[i]=='u' || s[i]=='a' || s[i]=='e'){
                schet=0;
                cout << s[i];
                ans.pb(s[i]);
            }
            else if (schet>=2){
                if (ans[ans.size()-1]!=s[i] || ans[ans.size()-2]!=s[i]){
                    cout << " " << s[i];
                    schet=1;
                    ans.pb(s[i]);
                }
                else{
                    cout << s[i];
                    ans.pb(s[i]);
                    schet++;
                }
            }
            else{
                cout << s[i];
                ans.pb(s[i]);
                schet++;
            }
        }
    return 0;
}


#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

    int n, schet;
    string s;
    vector <char> ans;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0);

    cin >> s;
    n=s.length();
        for (int i=0; i<n; i++){
            if (s[i]=='o' || s[i]=='i' || s[i]=='u' || s[i]=='a' || s[i]=='e'){
                schet=0;
                cout << s[i];
                ans.pb(s[i]);
            }
            else if (schet>=2){
                if (ans[ans.size()-1]!=s[i] && ans[ans.size()-2]!=s[i]){
                    cout << " " << s[i];
                    schet=1;
                    ans.pb(s[i]);
                }
                else{
                    cout << s[i];
                    ans.pb(s[i]);
                    schet++;
                }
            }
            else{
                cout << s[i];
                ans.pb(s[i]);
                schet++;
            }
        }
    return 0;
}


#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

    int n, schet;
    string s;
    vector <char> ans;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0);

    cin >> s;
    n=s.length();
        for (int i=0; i<n; i++){
            if (s[i]=='o' || s[i]=='i' || s[i]=='u' || s[i]=='a' || s[i]=='e'){
                schet=0;
                cout << s[i];
                ans.pb(s[i]);
            }
            else if (schet>=2){
                if (ans[ans.size()-1]!=s[i] && ans[ans.size()-2]!=s[i]){
                    cout << " " << s[i];
                    schet=1;
                    ans.pb(s[i]);
                }
                else{
                    ans.pb(s[i]);
                    schet++;
                }
            }
            else{
                cout << s[i];
                ans.pb(s[i]);
                schet++;
            }
        }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int isvowel(char a)
{
    if(a=='a')
    {
        return 1;
    }
    if(a=='e')
    {
        return 1;
    }
    if(a=='i')
    {
        return 1;
    }
    if(a=='o')
    {
        return 1;
    }
    if(a=='u')
    {
        return 1;
    }
    return 0;
}
int main()
{
    char t[1000];
    scanf("%s",t);
    int constack=0;
    int l = strlen(t);
    for(int i=0;i<l;i++)
    {
        if(isvowel(t[i]))
        {
            constack=0;
            printf("%c",t[i]);
        }
        else
        {
            if(constack)
            {
                if(i+1>=l||t[i+1]==t[i])
                {
                    printf("%c",t[i]);
                }
                else
                {
                    printf("%c ",t[i]);
                    constack=0;
                }
            }
            else
            {
                printf("%c",t[i]);
                constack=1;
            }
        }
    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int isvowel(char a)
{
    if(a=='a')
    {
        return 1;
    }
    if(a=='e')
    {
        return 1;
    }
    if(a=='i')
    {
        return 1;
    }
    if(a=='o')
    {
        return 1;
    }
    if(a=='u')
    {
        return 1;
    }
    return 0;
}
int main()
{
    char t[4000];
    scanf("%s",t);
    int constack=0;
    int l = strlen(t);
    for(int i=0;i<l;i++)
    {
        if(isvowel(t[i]))
        {
            constack=0;
        }
        if(!isvowel(t[i]))
        {
            constack++;
        }
        if(constack>=3)
        {
            if((t[i-2]==t[i-1])&&(t[i-1]==t[i]))
            {

            }
            else
            {
                printf(" ");
                constack=1;
            }
        }
        printf("%c",t[i]);
    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int isvowel(char a)
{
    if(a=='a')
    {
        return 1;
    }
    if(a=='e')
    {
        return 1;
    }
    if(a=='i')
    {
        return 1;
    }
    if(a=='o')
    {
        return 1;
    }
    if(a=='u')
    {
        return 1;
    }
    return 0;
}
int main()
{
    char t[1000];
    scanf("%s",t);
    int constack=0;
    int l = strlen(t);
    for(int i=0;i<l;i++)
    {
        if(isvowel(t[i]))
        {
            constack=0;
        }
        if(!isvowel(t[i]))
        {
            constack++;
        }
        if(constack==3)
        {
            if((t[i-2]==t[i-1])&&(t[i-1]==t[i]))
            {

            }
            else
            {
                printf(" ");
                constack=1;
            }
        }
        printf("%c",t[i]);
    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int isvowel(char a)
{
    if(a=='a')
    {
        return 1;
    }
    if(a=='e')
    {
        return 1;
    }
    if(a=='i')
    {
        return 1;
    }
    if(a=='o')
    {
        return 1;
    }
    if(a=='u')
    {
        return 1;
    }
    return 0;
}
int main()
{
    char t[1000];
    scanf("%s",t);
    int constack=0;
    int l = strlen(t);
    for(int i=0;i<l;i++)
    {
        if(isvowel(t[i]))
        {
            constack=0;
        }
        if(!isvowel(t[i]))
        {
            constack++;
        }
        if(constack==3)
        {
            if((t[i-2]==t[i-1])&&(t[i-1]==t[i]))
            {

            }
            else
            {
                printf(" ");
                constack=0;
            }
        }
        printf("%c",t[i]);
    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int isvowel(char a)
{
    if(a=='a')
    {
        return 1;
    }
    if(a=='e')
    {
        return 1;
    }
    if(a=='i')
    {
        return 1;
    }
    if(a=='o')
    {
        return 1;
    }
    if(a=='u')
    {
        return 1;
    }
    return 0;
}
int main()
{
    char t[4000];
    scanf("%s",t);
    int constack=0;
    int l = strlen(t);
    for(int i=0;i<l;i++)
    {
        if(isvowel(t[i]))
        {
            constack=0;
        }
        if(!isvowel(t[i]))
        {
            constack++;
        }
        if(constack==3)
        {
            if((t[i-2]==t[i-1])&&(t[i-1]==t[i]))
            {

            }
            else
            {
                printf(" ");
                constack=1;
            }
        }
        printf("%c",t[i]);
    }
}


#include <iostream>
#include <cmath>
#include <vector>
#include <string>

using namespace std;

typedef long long i64;

vector<char> letters = { 'a', 'e', 'i', 'o', 'u' };

bool is_s(char a)
{
	for (int i = 0; i < letters.size(); i++)
	{
		if (a == letters[i])
		{
			return false;
		}
	}
	return true;
}

int main()
{
	int count = 0;
	string str;
	cin >> str;

	if (is_s(str[0]))
	{
		count++;
	}
	cout << str[0];

	for (int i = 1; i < str.size(); i++)
	{
		if (is_s(str[i]))
		{
			count++;
			if ((str[i-1] != str[i]) && (count == 3))
			{
				cout << " ";
				count = 0;
			}
		}
		else
		{
			count = 0;
		}
		cout << str[i];
	}

	return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
#include <string>

using namespace std;

typedef long long i64;

vector<char> letters = { 'a', 'e', 'i', 'o', 'u' };

bool is_s(char a)
{
	for (int i = 0; i < letters.size(); i++)
	{
		if (a == letters[i])
		{
			return false;
		}
	}
	return true;
}

int main()
{
	string str;
	cin >> str;

	cout << str[0] << str[1];

	for (int i = 2; i < str.size(); i++)
	{
		if (is_s(str[i]))
		{
			if (is_s(str[i - 2]) && is_s(str[i]) && is_s(str[i - 1]) && ((str[i] != str[i - 1]) || (str[i - 2] != str[i - 1])))
			{
				cout << " " << str[i];
				i++;
			}
		}
		cout << str[i];
	}

	return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
#include <string>

using namespace std;

typedef long long i64;

vector<char> letters = { 'a', 'e', 'i', 'o', 'u' };

bool is_s(char a)
{
	for (int i = 0; i < letters.size(); i++)
	{
		if (a == letters[i])
		{
			return false;
		}
	}
	return true;
}

int main()
{
	string str;
	cin >> str;

	if (str.size() == 1)
	{
		cout << str;
		return 0;
	}

	cout << str[0] << str[1];

	for (int i = 2; i < str.size(); i++)
	{
		if (is_s(str[i]))
		{
			if (is_s(str[i - 2]) && is_s(str[i]) && is_s(str[i - 1]) && ((str[i] != str[i - 1]) || (str[i - 2] != str[i - 1])))
			{
				cout << " " << str[i];
				if (i == str.size() - 1) return 0;
				i++;
			}
		}
		cout << str[i];
	}

	return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
#include <string>

using namespace std;

typedef long long i64;

vector<char> letters = { 'a', 'e', 'i', 'o', 'u' };

bool is_s(char a)
{
	for (int i = 0; i < letters.size(); i++)
	{
		if (a == letters[i])
		{
			return false;
		}
	}
	return true;
}

int main()
{
	string str;
	cin >> str;

	cout << str[0] << str[1];

	for (int i = 2; i < str.size(); i++)
	{
		if (is_s(str[i]))
		{
			if (is_s(str[i-2]) && is_s(str[i]) && is_s(str[i-1]) && ((str[i] != str[i - 1]) || (str[i - 2] != str[i - 1])))
			{
				cout << " ";
			}
		}
		cout << str[i];
	}

	return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
#include <string>

using namespace std;

typedef long long i64;

vector<char> letters = { 'a', 'e', 'i', 'o', 'u' };

bool is_s(char a)
{
	for (int i = 0; i < letters.size(); i++)
	{
		if (a == letters[i])
		{
			return false;
		}
	}
	return true;
}

int main()
{
	string str;
	cin >> str;

	cout << str[0] << str[1];

	for (int i = 2; i < str.size(); i++)
	{
		if (is_s(str[i]))
		{
			if (is_s(str[i - 2]) && is_s(str[i]) && is_s(str[i - 1]) && ((str[i] != str[i - 1]) || (str[i - 2] != str[i - 1])))
			{
				cout << " " << str[i];
				if (i == str.size() - 1) return 0;
				i++;
			}
		}
		cout << str[i];
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(),v.end()
ll M=100000000000;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
ll t=1;
while(t--){
   string s;
   cin>>s;
   ll ans=0;
   vector<ll>v;
   v.push_back(0);
   set<char>se;
   ll i=0;
   while(i<s.length()){
       if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){
           ans=0;
           se.clear();
       }
       else{
           se.insert((char)s[i]);
           ans++;
           if(ans==3&& se.size()>1){
               v.push_back(i);
               se.clear();
               ans=1;
               se.insert(s[i]);

           }
           else if(ans==3&& se.size()==1){

               ans=2;

           }

       }
       i++;

   }v.push_back(s.length());
   //cout<<v[v.size()-2]<<" "<<v[v.size()-1];
   //cout<<v.size();
   for(ll i=0;i<v.size()-1;i++){
       cout<<s.substr(v[i],v[i+1]-v[i])<<" ";
   }

 }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(),v.end()
ll M=100000000000;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
ll t=1;
while(t--){
   string s;
   cin>>s;
   ll ans=0;
   vector<ll>v;
   v.push_back(0);
   set<char>se;
   ll i=0;
   while(i<s.length()){
       if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){
           ans=0;
       }
       else{
           se.insert((char)s[i]);
           ans++;
           if(ans==3&& se.size()>1){
               v.push_back(i);
               se.clear();
               ans=1;
               se.insert(s[i]);

           }
           else if(ans==3&& se.size()==1){
               ans=0;
               se.clear();
           }

       }
       i++;

   }v.push_back(s.length());
   cout<<v[v.size()-2]<<" "<<v[v.size()-1];
   for(ll i=0;i<v.size()-1;i++){
       cout<<s.substr(v[i],v[i+1]-v[i])<<" ";
   }

 }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(),v.end()
ll M=100000000000;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
ll t=1;
while(t--){
   string s;
   cin>>s;
   ll ans=0;
   vector<ll>v;
   v.push_back(0);
   set<char>se;
   ll i=0;
   while(i<s.length()){
       if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){
           ans=0;
       }
       else{
           se.insert((char)s[i]);
           ans++;
           if(ans==3&& se.size()>1){
               v.push_back(i);
               ans=1;
               se.clear();
           }
           else if(ans==3&& se.size()==1){
               ans=1;
               se.clear();
           }

       }
       i++;

   }v.push_back(s.length());

   for(ll i=0;i<v.size()-1;i++){
       cout<<s.substr(v[i],v[i+1]-v[i])<<" ";
   }

 }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(),v.end()
ll M=100000000000;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
ll t=1;
while(t--){
   string s;
   cin>>s;
   ll ans=0;
   vector<ll>v;
   v.push_back(0);
   ll i=0;
   while(i<s.length()){
       if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){
           ans=0;
       }
       else{

           ans++;
           if(ans==3){
               v.push_back(i);
               ans=1;
           }

       }
       i++;

   }v.push_back(s.length());
   for(ll i=0;i<v.size()-1;i++){
       cout<<s.substr(v[i],v[i+1]-v[i])<<" ";
   }

 }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(),v.end()
ll M=100000000000;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
ll t=1;
while(t--){
   string s;
   cin>>s;
   ll ans=0;
   vector<ll>v;
   v.push_back(0);
   set<char>se;
   ll i=0;
   while(i<s.length()){
       if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){
           ans=0;
       }
       else{
           se.insert((char)s[i]);
           ans++;
           if(ans==3&& se.size()>1){
               v.push_back(i);
               se.clear();
               ans=1;
               se.insert(s[i]);

           }
           else if(ans==3&& se.size()==1){
               ans=0;
               se.clear();
           }

       }
       i++;

   }v.push_back(s.length());
   //cout<<v[v.size()-2]<<" "<<v[v.size()-1];
   for(ll i=0;i<v.size()-1;i++){
       cout<<s.substr(v[i],v[i+1]-v[i])<<" ";
   }

 }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(),v.end()
ll M=100000000000;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
ll t=1;
while(t--){
   string s;
   cin>>s;
   ll ans=0;
   vector<ll>v;
   v.push_back(0);
   set<char>se;
   ll i=0;
   while(i<s.length()){
       if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){
           ans=0;
           se.clear();
       }
       else{
           se.insert((char)s[i]);
           ans++;
           if(ans==3&& se.size()>1){
               v.push_back(i);
               se.clear();
               ans=1;
               se.insert(s[i]);

           }
           else if(ans==3&& se.size()==1){
               se.clear();
               ans=0;
           }

       }
       i++;

   }v.push_back(s.length());
   //cout<<v[v.size()-2]<<" "<<v[v.size()-1];
   //cout<<v.size();
   for(ll i=0;i<v.size()-1;i++){
       cout<<s.substr(v[i],v[i+1]-v[i])<<" ";
   }

 }
}


# include <bits/stdc++.h>

# define y1 aklsdjskldjls

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;

const int N = int(4e5) + 5;
const int inf = (int)1e9 + 7;
const ll linf = (ll)1e17 + 7;
const ld eps = 1e-7;

ll ond = 1, e, q, k, zero;
string s;
char check(char x){
  if(x != 'a' && x != 'e' && x != 'i' && x != 'o' && x != 'u')
    return 1;
  return 0;
}
int main(){
  cin >> s;
  cout << s[0];
  for(ll i = 1; i < s.size(); i++){
    if(check(s[i])){
      q++;
      if(check(s[i - 1]))
        if(s[i - 1] != s[i])
          e = 1;
    }
    else
      q = 0, e = 0;
    //cout << q << " " << e << "\n";
    if(q >= 3 && e == 1)
      q = 1, cout << " ";
    cout << s[i];
  }
  return 0;
}


# include <bits/stdc++.h>

# define y1 aklsdjskldjls

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;

const int N = int(4e5) + 5;
const int inf = (int)1e9 + 7;
const ll linf = (ll)1e17 + 7;
const ld eps = 1e-7;

ll ond = 1, e, q, k, zero;
string s;
char check(char x){
  if(x != 'a' && x != 'e' && x != 'i' && x != 'o' && x != 'u')
    return 1;
  return 0;
}
int main(){
  cin >> s;
  cout << s[0];
  if(check(s[0]))
    q = 1;
  for(ll i = 1; i < s.size(); i++){
    if(check(s[i])){
      q++;
      if(check(s[i - 1]))
        if(s[i - 1] != s[i])
          e = 1;
    }
    else
      q = 0, e = 0;
   // cout << q << " " << e << "\n";
    if(q >= 3 && e == 1)
      q = 1, cout << " ";
    cout << s[i];
  }
  return 0;
}


# include <bits/stdc++.h>

# define y1 aklsdjskldjls

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;

const int N = int(4e5) + 5;
const int inf = (int)1e9 + 7;
const ll linf = (ll)1e17 + 7;
const ld eps = 1e-7;

ll ond = 1, e, q, k, zero;
string s;
char check(char x){
  if(x != 'a' && x != 'e' && x != 'i' && x != 'o' && x != 'u')
    return 1;
  return 0;
}
int main(){
  cin >> s;
  for(ll i = 0; i < s.size(); i++){
    if(check(s[i])){
      q++;
      if(check(s[i + 1]) && i + 1 < s.size())
        if(s[i + 1] != s[i])
          e = 1;
    }
    else
      q = 0, e = 0;
    if(q >= 3 && e == 1)
      q = 1, cout << " ";
    cout << s[i];
  }
  return 0;
}


# include <bits/stdc++.h>

# define y1 aklsdjskldjls

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;

const int N = int(4e5) + 5;
const int inf = (int)1e9 + 7;
const ll linf = (ll)1e17 + 7;
const ld eps = 1e-7;

ll ond = 1, e, q, k, zero;
string s;
char check(char x){
  if(x != 'a' && x != 'e' && x != 'i' && x != 'o' && x != 'u')
    return 1;
  return 0;
}
int main(){
  cin >> s;
  for(ll i = 0; i < s.size(); i++){
    if(check(s[i])){
      q++;
      if(check(s[i + 1]))
        if(s[i + 1] != s[i])
          e = 1;
    }
    else
      q = 0, e = 0;
    if(q >= 3 && e == 1)
      q = 1, cout << " ";
    cout << s[i];
  }
  return 0;
}


# include <bits/stdc++.h>

# define y1 aklsdjskldjls

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;

const int N = int(4e5) + 5;
const int inf = (int)1e9 + 7;
const ll linf = (ll)1e17 + 7;
const ld eps = 1e-7;

ll ond = 1, e, q, k, zero;
string s;
char check(char x){
  if(x != 'a' && x != 'e' && x != 'i' && x != 'o' && x != 'u')
    return 1;
  return 0;
}
int main(){
  cin >> s;
  for(ll i = 0; i < s.size(); i++){
    if(check(s[i])){
      q++;
    }
    else
      q = 0;
    cout << s[i];
    if(q >= 3 && s[i] != s[i - 1])
      q = 0, cout << " ";
  }
  return 0;
}


# include <bits/stdc++.h>

# define y1 aklsdjskldjls

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;

const int N = int(4e5) + 5;
const int inf = (int)1e9 + 7;
const ll linf = (ll)1e17 + 7;
const ld eps = 1e-7;

ll ond = 1, e, q, k, zero;
string s;
char check(char x){
  if(x != 'a' && x != 'e' && x != 'i' && x != 'o' && x != 'u')
    return 1;
  return 0;
}
int main(){
  cin >> s;
  cout << s[0];
  for(ll i = 1; i < s.size(); i++){
    if(check(s[i])){
      q++;
      if(check(s[i - 1]))
        if(s[i + 1] != s[i])
          e = 1;
    }
    else
      q = 0, e = 0;
    if(q >= 3 && e == 1)
      q = 1, cout << " ";
    cout << s[i];
  }
  return 0;
}