import java.util.*;
public class MyClass {
static int get_last_character_repeated(String s) {
int len = s.length(), ch_idx = -1;
for (int i = 0; i < len; i++) {
for (int j = i + 1; j < len; j++) {
if (s.charAt(i) ==s.charAt(j)) {
ch_idx = i;
break;
}
}
}
return ch_idx;
}
public static void main(String args[]) {
String s = "abcdxypcbadom";
int i = get_last_character_repeated(s);
if (i == -1)
System.out.println("Not found");
else
System.out.println(s.charAt(i));
}
}
/*
run:
d
*/