/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
static Iterable<Integer> range(final int from, final int to) {
return new Iterable<Integer>() {
public Iterator<Integer> iterator() {
return new Iterator<Integer>() {
int current = from;
public boolean hasNext() { return current < to; }
return current++;
}
public void remove() {}
};
}
};
}
{
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXN0YXRpYyBJdGVyYWJsZTxJbnRlZ2VyPiByYW5nZShmaW5hbCBpbnQgZnJvbSwgZmluYWwgaW50IHRvKSB7CgkJcmV0dXJuIG5ldyBJdGVyYWJsZTxJbnRlZ2VyPigpIHsKCQkJcHVibGljIEl0ZXJhdG9yPEludGVnZXI+IGl0ZXJhdG9yKCkgewoJCQkJcmV0dXJuIG5ldyBJdGVyYXRvcjxJbnRlZ2VyPigpIHsKCQkJCQlpbnQgY3VycmVudCA9IGZyb207CgkJCQkJcHVibGljIGJvb2xlYW4gaGFzTmV4dCgpIHsgcmV0dXJuIGN1cnJlbnQgPCB0bzsgfQogICAgICAgICAgICAgICAgICAgIHB1YmxpYyBJbnRlZ2VyIG5leHQoKSB7CiAgICAgICAgICAgICAgICAgICAgCWlmICghaGFzTmV4dCgpKSB7IHRocm93IG5ldyBOb1N1Y2hFbGVtZW50RXhjZXB0aW9uKCk7IH0KICAgICAgICAgICAgICAgICAgICAJcmV0dXJuIGN1cnJlbnQrKzsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcmV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