import java.util.Arrays;
import java.util.List;
public class Main {
List
<Human
> humans
= Arrays.
asList(new GenericHuman
(),
new BeautifulGirl
(),
new GenericHuman
()); for (Human human : humans) {
if (human.isBeautifulGirl()) {
System.
out.
println("美少女はうんこしません!"); } else {
((GenericHuman)human).defecate();
}
}
}
}
interface Human {
boolean isBeautifulGirl();
}
class GenericHuman implements Human {
@Override
public boolean isBeautifulGirl() {
return false;
}
public final void defecate() {
}
}
class BeautifulGirl implements Human {
private GenericHuman genericHuman;
public BeautifulGirl() {
this(new GenericHuman());
}
public BeautifulGirl(GenericHuman genericHuman) {
this.genericHuman = genericHuman;
}
@Override
public final boolean isBeautifulGirl() {
return true;
}
private void defecate() {
genericHuman.defecate();
}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheXM7CmltcG9ydCBqYXZhLnV0aWwuTGlzdDsKCnB1YmxpYyBjbGFzcyBNYWluIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBFeGNlcHRpb24gewoJCUxpc3Q8SHVtYW4+IGh1bWFucyA9IEFycmF5cy5hc0xpc3QobmV3IEdlbmVyaWNIdW1hbigpLCBuZXcgQmVhdXRpZnVsR2lybCgpLCBuZXcgR2VuZXJpY0h1bWFuKCkpOwoJCWZvciAoSHVtYW4gaHVtYW4gOiBodW1hbnMpIHsKCQkJaWYgKGh1bWFuLmlzQmVhdXRpZnVsR2lybCgpKSB7CgkJCQlTeXN0ZW0ub3V0LnByaW50bG4oIue+juWwkeWls+OBr+OBhuOCk+OBk+OBl+OBvuOBm+OCkyEiKTsKCQkJfSBlbHNlIHsKCQkJCSgoR2VuZXJpY0h1bWFuKWh1bWFuKS5kZWZlY2F0ZSgpOwoJCQl9CgkJfQoJfQp9CgppbnRlcmZhY2UgSHVtYW4gewoJYm9vbGVhbiBpc0JlYXV0aWZ1bEdpcmwoKTsKfQoKY2xhc3MgR2VuZXJpY0h1bWFuIGltcGxlbWVudHMgSHVtYW4gew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