function Main(input) { input = input.split(' '); let min = input[0]; let max = input[1]; for(var i = min; i <= max; i++) { let num = i; if (num % 3 == 0) { console.log(num); } else if (num.indexOf('3') !== -1) { console.log(num); } } } Main(require('fs').readFileSync('/dev/stdin', 'utf8'));