interface Endl {
abstract void endl(myInteger i);
}
class myInteger {
private int n;
private boolean flag;
private myInteger fizzbuzzgizz
(int m,
String mes, Endl endl
) { if (this.n % m == 0) {
this.flag = false;
}
if (endl != null) endl.endl(this);
return this;
}
public myInteger(int n) { this.n = n; flag = true; }
public myInteger fizz() { return this.fizzbuzzgizz(3, "Fizz", null); }
public myInteger buzz() { return this.fizzbuzzgizz(5, "Buzz", null); }
public myInteger gizz() { return this.fizzbuzzgizz(7, "Gizz", new Endl() {
public void endl(myInteger i) {
if (i.flag == true)
else
} }); }
}
class Main {
public static void main
(String[] args
) { new myInteger(1).fizz().buzz().gizz();
new myInteger(3).fizz().buzz().gizz();
new myInteger(5).fizz().buzz().gizz();
new myInteger(7).fizz().buzz().gizz();
new myInteger(15).fizz().buzz().gizz();
new myInteger(21).fizz().buzz().gizz();
new myInteger(35).fizz().buzz().gizz();
new myInteger(105).fizz().buzz().gizz();
new myInteger(997).fizz().buzz().gizz();
}
}
/* end */
aW50ZXJmYWNlIEVuZGwgewogIGFic3RyYWN0IHZvaWQgZW5kbChteUludGVnZXIgaSk7Cn0KCmNsYXNzIG15SW50ZWdlciB7CiAgcHJpdmF0ZSBpbnQgbjsKICBwcml2YXRlIGJvb2xlYW4gZmxhZzsKICBwcml2YXRlIG15SW50ZWdlciBmaXp6YnV6emdpenooaW50IG0sIFN0cmluZyBtZXMsIEVuZGwgZW5kbCkgewogICAgaWYgKHRoaXMubiAlIG0gPT0gMCkgewogICAgICB0aGlzLmZsYWcgPSBmYWxzZTsKICAgICAgU3lzdGVtLm91dC5wcmludChtZXMpOwogICAgfQogICAgaWYgKGVuZGwgIT0gbnVsbCkgZW5kbC5lbmRsKHRoaXMpOwogICAgcmV0dXJuIHRoaXM7CiAgfQogIHB1YmxpYyBteUludGVnZXIoaW50IG4pIHsgdGhpcy5uID0gbjsgZmxhZyA9IHRydWU7IH0KICBwdWJsaWMgbXlJbnRlZ2VyIGZpenooKSB7IHJldHVybiB0aGlzLmZpenpidXp6Z2l6eigzLCAiRml6eiIsIG51bGwpOyB9CiAgcHVibGljIG15SW50ZWdlciBidXp6KCkgeyByZXR1cm4gdGhpcy5maXp6YnV6emdpenooNSwgIkJ1enoiLCBudWxsKTsgfQogIHB1YmxpYyBteUludGVnZXIgZ2l6eigpIHsgcmV0dXJuIHRoaXMuZml6emJ1enpnaXp6KDcsICJHaXp6IiwgbmV3IEVuZGwoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIGVuZGwobXlJbnRlZ2VyIGkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaS5mbGFnID09IHRydWUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oaS5uKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IH0pOyB9Cn0KCmNsYXNzIE1haW4gewogIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgIG5ldyBteUludGVnZXIoMSkuZml6eigpLmJ1enooKS5naXp6KCk7CiAgICBuZXcgbXlJbnRlZ2VyKDMpLmZpenooKS5idXp6KCkuZ2l6eigpOwogICAgbmV3IG15SW50ZWdlcig1KS5maXp6KCkuYnV6eigpLmdpenooKTsKICAgIG5ldyBteUludGVnZXIoNykuZml6eigpLmJ1enooKS5naXp6KCk7CiAgICBuZXcgbXlJbnRlZ2VyKDE1KS5maXp6KCkuYnV6eigpLmdpenooKTsKICAgIG5ldyBteUludGVnZXIoMjEpLmZpenooKS5idXp6KCkuZ2l6eigpOwogICAgbmV3IG15SW50ZWdlcigzNSkuZml6eigpLmJ1enooKS5naXp6KCk7CiAgICBuZXcgbXlJbnRlZ2VyKDEwNSkuZml6eigpLmJ1enooKS5naXp6KCk7CiAgICBuZXcgbXlJbnRlZ2VyKDk5NykuZml6eigpLmJ1enooKS5naXp6KCk7CiAgfQp9Ci8qIGVuZCAqLwo=