import std.stdio, std.string, std.conv, std.algorithm, std.numeric; import std.range, std.array, std.math, std.typecons, std.container, core.bitop; void main() { char[] n; scan(n); reverse(n); int k = n.length.to!int; int m3, m5; foreach (i; 0 .. k) { (m3 += n[i] - '0') %= 3; if (i & 1) { (m5 += n[i] - '0') %= 5; } else { (m5 += (n[i] - '0') * 4) %= 5; } } debug { writefln("m3:%d, m5:%d", m3, m5); } if (!m3 & !m5) { writeln("FizzBuzz"); } else if (!m3) { writeln("Fizz"); } else if (!m5) { writeln("Buzz"); } else { writeln(n.retro()); } } void scan(T...)(ref T args) { string[] line = readln.split; foreach (ref arg; args) { arg = line.front.to!(typeof(arg)); line.popFront(); } assert(line.empty); } void fillAll(R, T)(ref R arr, T value) { static if (is(typeof(arr[] = value))) { arr[] = value; } else { foreach (ref e; arr) { fillAll(e, value); } } }