import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
List<String> l = new ArrayList<>();
l.add(0, "Hello");
l.add(1, "World");
reverse(l);
}
public static <E> void reverse(List<E> list) {
E temp = null;
List<E> out = new ArrayList<E>();
for (int i=0;i<list.size()/2;i++) {
temp = list.get(i);
list.set(i, list.get(list.size()-i-1));
list.set(list.size()-i-1, temp);
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewogICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSAgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24gewogICAgICBMaXN0PFN0cmluZz4gbCA9IG5ldyBBcnJheUxpc3Q8PigpOwogICAgICBsLmFkZCgwLCAiSGVsbG8iKTsKICAgICAgbC5hZGQoMSwgIldvcmxkIik7CgogICAgICBmb3IoU3RyaW5nIHMgOiBsKSBTeXN0ZW0ub3V0LnByaW50KHMgKyAiICIpOwogICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIiIpOwogICAgICAKICAgICAgcmV2ZXJzZShsKTsKCiAgICAgIGZvcihTdHJpbmcgcyA6IGwpIFN5c3RlbS5vdXQucHJpbnQocyArICIgIik7CiAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiIik7CiAgIH0KCiAgIHB1YmxpYyBzdGF0aWMgPEU+IHZvaWQgcmV2ZXJzZShMaXN0PEU+IGxpc3QpIHsKICAgICAgRSB0ZW1wID0gbnVsbDsKICAgICAgTGlzdDxFPiBvdXQgPSBuZXcgQXJyYXlMaXN0PEU+KCk7CiAgICAgIGZvciAoaW50IGk9MDtpPGxpc3Quc2l6ZSgpLzI7aSsrKSB7CiAgICAgICAgICB0ZW1wID0gbGlzdC5nZXQoaSk7CiAgICAgICAgICBsaXN0LnNldChpLCBsaXN0LmdldChsaXN0LnNpemUoKS1pLTEpKTsKICAgICAgICAgIGxpc3Quc2V0KGxpc3Quc2l6ZSgpLWktMSwgdGVtcCk7CiAgICAgIH0KCX0KfQo=