// Arup Guha
// 8/15/2014
// Solution to 2014 UCF Locals Problem: Vowel Count

import java.util.*;
import java.io.*;

public class vowel {

	final public static char[] VOWELS = {'a','e','i','o','u'};

	public static void main(String[] args) throws Exception {

		Scanner stdin = new Scanner(new File("vowel.in"));
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int loop=0; loop<numCases; loop++) {

			// Echo name.
			String name = stdin.next();
			System.out.println(name);

			// Print result.
			if (hasMoreVowels(name))
				System.out.println("1");
			else
				System.out.println("0");
		}
		
		stdin.close();
	}

	public static boolean hasMoreVowels(String s) {

		// Counts up all vowels.
		int cnt = 0;
		for (int i=0; i<s.length(); i++)
			for (int j=0; j<VOWELS.length; j++)
				if (s.charAt(i) == VOWELS[j])
					cnt++;

		// This is our true condition.
		return cnt > s.length()/2;
	}
}