public void solve() throws IOException {
    List<Letter> odd = new ArrayList<Letter>();
    List<Letter> even = new ArrayList<Letter>();
    List<Letter> oddvowels = new ArrayList<Letter>();
    List<Letter> evenvowels = new ArrayList<Letter>();

    
    String[] data = nextLine().split(" ");
    for (int x = 0; x < data.length; x += 2) {
      int value = Integer.parseInt(data[x + 1]);
      if (value % 2 == 0) {
        even.add(new Letter(data[x], value));
      } else {
        odd.add(new Letter(data[x], value));
      }
      
      if (isVowel(data[x])) {
        if (value % 2 == 0) {
          evenvowels.add(new Letter(data[x], value));
        } else {
          evenvowels.add(new Letter(data[x], value));
        }
      }
    }
    
    Collections.sort(odd);
    Collections.sort(even);
    Collections.sort(oddvowels);
    Collections.sort(evenvowels);
  }