const yourAnswerFunctionComesHere = data => {
  const splitedData = data.split(" ");
  const sortedData = splitedData.sort((x, y) => y - x);
  let answerString = "";
  for(let i = 0; i < sortedData.length; i++) {
    answerString += sortedData[i];
    if(i < sortedData.length - 1) {
      answerString += " ";
    }
  }
  console.log(answerString);
}

const readFile = path => {
  fs.readFile(path, 'utf8', (err, data) => {
    yourAnswerFunctionComesHere(data);
  });
}

const readFileWithoutArg = () => {
  const data = require('fs').readFileSync('/dev/stdin', 'utf8');
  yourAnswerFunctionComesHere(data);
}

let sampleInputPath = "";

if(process.argv.length > 2) {
  sampleInputPath = process.argv[2];
  readFile(sampleInputPath);
} else {
  readFileWithoutArg();
}
