const lines = require('fs') .readFileSync('/dev/stdin', 'utf-8') .trim().split('\n').values(); let N = lines.next().value; let ans = []; N = [...N].reverse(); for (let i = 0; i < N.length; i++) { ans.push(N[i]); if (i % 3 === 2 && i < N.length - 1) ans.push(','); } console.log(ans.reverse().join(''));