/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String s1 = "transaction";
        System.out.println(getFirstUniqueChar(s1));

        String s2 = "reverse";
        System.out.println(getFirstUniqueChar(s2));
	}
	
	public static char getFirstUniqueChar(String s) {
        int[] temp = new int[26];
        int alphabetNum;
        for (int i = 0; i < s.length(); i++) {
            alphabetNum = getAlphabetNum(s.charAt(i));
            if (temp[alphabetNum] == 0) {
                temp[alphabetNum] = i;
            } else {
                temp[alphabetNum] = -1;
            }
        }

        for (int i = 0; i < s.length(); i++) {
            alphabetNum = getAlphabetNum(s.charAt(i));
            if (temp[alphabetNum] == i) {
                return s.charAt(i);
            }
        }
        return ' ';
    }

    public static final int getAlphabetNum(char c) {
        c = Character.toLowerCase(c);
        return c - 'a';
    }
}