function solution(num, str) {
const arry = str.split("-");
const first = arry[0];
const other = arry
.map((item, index) => {
return index > 0 ? item : "";
})
.join("")
.replace(/.{3}/g, "$&-");
const result = `${
first}-${
other}`;
return result;
}