function Main (input) { var line = input.split('').map(Number); var value = 0; for ( var i = 0; 0 < line.length; i++){ value += line.pop() * ( 4 ** i) }; if(value % 3 == 0 && value % 5 == 0 ){ console.log('FizzBuzz'); } else if (value % 3 == 0){ console.log('Fizz'); } else if (value % 5 == 0){ console.log('Buzz'); } else { console.log(input); } } Main(require('fs').readFileSync('/dev/stdin','utf8'));