class myInteger {
private int n;
private myInteger fizzbuzzgizz
(int m,
String mes
) { if (this.n % m == 0) { buff.append(mes); }
return this;
}
public myInteger
(int n
) { this.
n = n
; buff
= new StringBuffer(); } if (this.buff.length() == 0)
else
return buff.toString();
}
public myInteger fizz() { return this.fizzbuzzgizz(3, "Fizz"); }
public myInteger buzz() { return this.fizzbuzzgizz(5, "Buzz"); }
public myInteger gizz() { return this.fizzbuzzgizz(7, "Gizz"); }
}
class Main {
public static void main
(String[] args
) { System.
out.
println(new myInteger
(1).
fizz().
buzz().
gizz()); System.
out.
println(new myInteger
(3).
fizz().
buzz().
gizz()); System.
out.
println(new myInteger
(5).
fizz().
buzz().
gizz()); System.
out.
println(new myInteger
(7).
fizz().
buzz().
gizz()); System.
out.
println(new myInteger
(15).
fizz().
buzz().
gizz()); System.
out.
println(new myInteger
(21).
fizz().
buzz().
gizz()); System.
out.
println(new myInteger
(35).
fizz().
buzz().
gizz()); System.
out.
println(new myInteger
(105).
fizz().
buzz().
gizz()); System.
out.
println(new myInteger
(997).
fizz().
buzz().
gizz()); }
}
/* end */
Y2xhc3MgbXlJbnRlZ2VyIHsKICBwcml2YXRlIGludCBuOwogIHByaXZhdGUgU3RyaW5nQnVmZmVyIGJ1ZmY7CiAgcHJpdmF0ZSBteUludGVnZXIgZml6emJ1enpnaXp6KGludCBtLCBTdHJpbmcgbWVzKSB7CiAgICBpZiAodGhpcy5uICUgbSA9PSAwKSB7IGJ1ZmYuYXBwZW5kKG1lcyk7IH0KICAgIHJldHVybiB0aGlzOwogIH0KICBwdWJsaWMgbXlJbnRlZ2VyKGludCBuKSB7IHRoaXMubiA9IG47IGJ1ZmYgPSBuZXcgU3RyaW5nQnVmZmVyKCk7IH0KICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewogICAgaWYgKHRoaXMuYnVmZi5sZW5ndGgoKSA9PSAwKQogICAgICByZXR1cm4gbmV3IEludGVnZXIobikudG9TdHJpbmcoKTsKICAgIGVsc2UgCiAgICAgIHJldHVybiBidWZmLnRvU3RyaW5nKCk7CiAgfQoKICBwdWJsaWMgbXlJbnRlZ2VyIGZpenooKSB7IHJldHVybiB0aGlzLmZpenpidXp6Z2l6eigzLCAiRml6eiIpOyB9CiAgcHVibGljIG15SW50ZWdlciBidXp6KCkgeyByZXR1cm4gdGhpcy5maXp6YnV6emdpenooNSwgIkJ1enoiKTsgfQogIHB1YmxpYyBteUludGVnZXIgZ2l6eigpIHsgcmV0dXJuIHRoaXMuZml6emJ1enpnaXp6KDcsICJHaXp6Iik7IH0KfQoKY2xhc3MgTWFpbiB7CiAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgU3lzdGVtLm91dC5wcmludGxuKG5ldyBteUludGVnZXIoMSkuZml6eigpLmJ1enooKS5naXp6KCkpOwogICAgU3lzdGVtLm91dC5wcmludGxuKG5ldyBteUludGVnZXIoMykuZml6eigpLmJ1enooKS5naXp6KCkpOwogICAgU3lzdGVtLm91dC5wcmludGxuKG5ldyBteUludGVnZXIoNSkuZml6eigpLmJ1enooKS5naXp6KCkpOwogICAgU3lzdGVtLm91dC5wcmludGxuKG5ldyBteUludGVnZXIoNykuZml6eigpLmJ1enooKS5naXp6KCkpOwogICAgU3lzdGVtLm91dC5wcmludGxuKG5ldyBteUludGVnZXIoMTUpLmZpenooKS5idXp6KCkuZ2l6eigpKTsKICAgIFN5c3RlbS5vdXQucHJpbnRsbihuZXcgbXlJbnRlZ2VyKDIxKS5maXp6KCkuYnV6eigpLmdpenooKSk7CiAgICBTeXN0ZW0ub3V0LnByaW50bG4obmV3IG15SW50ZWdlcigzNSkuZml6eigpLmJ1enooKS5naXp6KCkpOwogICAgU3lzdGVtLm91dC5wcmludGxuKG5ldyBteUludGVnZXIoMTA1KS5maXp6KCkuYnV6eigpLmdpenooKSk7CiAgICBTeXN0ZW0ub3V0LnByaW50bG4obmV3IG15SW50ZWdlcig5OTcpLmZpenooKS5idXp6KCkuZ2l6eigpKTsKICB9Cn0KLyogZW5kICovCg==