function main(S) { console.log(S.replace(/treeone/g, 'forest')); }