function main(input) { const env = getLineNumArray(input); const a = env[0]; const b = env[1]; let answer = ""; for (let i = a; i <= b; i++) { if (hit(i)) { answer += i + "\n"; } } console.log(answer); } function hit(num) { if (num % 3 === 0) { return true; } if (String(num).indexOf("3") !== -1) { return true; } return false; } function getLineNumArray(line) { const line_str_array = line.split(" "); let line_array = []; line_str_array.forEach(num_str => { line_array.push(parseInt(num_str)); }); return line_array; } main(require("fs").readFileSync("/dev/stdin", "utf8")); // main(require("fs").readFileSync("./files/yuki.txt", "utf8"));