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