import java.util.*;
class OdaiUniqSortRev {
public static int[] uniq(int[] a) {
return Arrays.
stream(a
).
distinct().
toArray(); }
public static int[] sort(int[] a) {
int[] b
= Arrays.
copyOf(a, a.
length); return b;
}
public static int[] reverse(int[] a) {
int[] b
= Arrays.
copyOf(a, a.
length); for (int i = 0, j = b.length - 1; i < j; i++, j--) {
int t = b[i];b[i] = b[j];b[j] = t;
}
return b;
}
private static void p(int[] a) {
}
public static void main
(String[] args
) { int[] a = {3, 1, 4, 1, 5};
p(reverse(sort(uniq(a))));
}
}
aW1wb3J0IGphdmEudXRpbC4qOwpjbGFzcyBPZGFpVW5pcVNvcnRSZXYgewoJcHVibGljIHN0YXRpYyBpbnRbXSB1bmlxKGludFtdIGEpIHsKCQlyZXR1cm4gQXJyYXlzLnN0cmVhbShhKS5kaXN0aW5jdCgpLnRvQXJyYXkoKTsKCX0KCXB1YmxpYyBzdGF0aWMgaW50W10gc29ydChpbnRbXSBhKSB7CgkJaW50W10gYiA9IEFycmF5cy5jb3B5T2YoYSwgYS5sZW5ndGgpOwoJCUFycmF5cy5zb3J0KGIpOwoJCXJldHVybiBiOwoJfQoJcHVibGljIHN0YXRpYyBpbnRbXSByZXZlcnNlKGludFtdIGEpIHsKCQlpbnRbXSBiID0gQXJyYXlzLmNvcHlPZihhLCBhLmxlbmd0aCk7CgkJZm9yIChpbnQgaSA9IDAsIGogPSBiLmxlbmd0aCAtIDE7IGkgPCBqOyBpKyssIGotLSkgewoJCQlpbnQgdCA9IGJbaV07YltpXSA9IGJbal07YltqXSA9IHQ7CgkJfQoJCXJldHVybiBiOwoJfQoJcHJpdmF0ZSBzdGF0aWMgdm9pZCBwKGludFtdIGEpIHsKCQlTeXN0ZW0ub3V0LnByaW50bG4oQXJyYXlzLnRvU3RyaW5nKGEpKTsKCX0KCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKCQlpbnRbXSBhID0gezMsIDEsIDQsIDEsIDV9OwoJCXAocmV2ZXJzZShzb3J0KHVuaXEoYSkpKSk7CgkJcChBcnJheXMuc3RyZWFtKGEpLmJveGVkKCkuZGlzdGluY3QoKS5zb3J0ZWQoQ29tcGFyYXRvci5yZXZlcnNlT3JkZXIoKSkubWFwVG9JbnQoSW50ZWdlcjo6aW50VmFsdWUpLnRvQXJyYXkoKSk7Cgl9Cn0K