import java.util.Scanner;
public static void main(String[] args) {
System.out.print("Enter ten integers: ");
ArrayList<Integer> list = new ArrayList<>();
Scanner input = new Scanner(System.in);
for(int i = 0;i < 10;i++)
list.add(input.nextInt());
removeDuplicate(list);
System.out.print("The distinct integers are " );
for(int i = 0 ;i < list.size();i++)
System.out.print(list.get(i) + " ");
}
public static void removeDuplicate(ArrayList<Integer> list) {
for(int i = 0;i < list.size();i++) {
Integer temp = list.get(0);
while(list.contains(temp))
list.remove(temp);
list.add(temp);
}
}