function main(input = '') { if (!input) throw Error; let lines = input.split('\n'); let [begin, end] = lines[0].split(' ').map((val) => parseInt(val)); let list = []; for (let i = begin; i <= end; i++) { if (i % 3 === 0 || String(i).includes('3')) list.push(i); } return list.join('\n'); } const { readFileSync, existsSync } = require('fs'); const stdin = '/dev/stdin'; if (existsSync(stdin)) { const input = readFileSync(stdin, 'utf8'); console.log(main(input)); } module.exports = main;