class FirstUniqueCharFinder {

  static char find(String word) {
    int len = word.length();
    char firstUniqueChar = 0;

    for (int i = 0; i < len; i++) {
      char currentChar = word.charAt(i);
      if (word.indexOf(currentChar, i + 1) == -1) {
        firstUniqueChar = currentChar;
        break;
      }
    }

    return firstUniqueChar;
  }

  public static void main(String[] args) {
    System.out.println(find("transaction"));
    System.out.println(find("reverse"));
  }
}