import java.util.*;
import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        HashMap<Character, Integer> hm = new HashMap<>();
        for(Character ch: s.toCharArray())
        {
            hm.put(ch,hm.getOrDefault(ch,0)+1);
        }
        int flag=0;
        for(Character k: hm.keySet())
        {
            if(hm.get(k)==1)
            {
                System.out.println(k);
                flag=1;break;
            }
        }
        if(flag==0)
        {
            System.out.println("nil");
        }
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: