while(line = readline()) {
var str = line.trim()
var index = str.length
var tempArr = []
var normalScanCount = 0
while(index--) {
var ch = str[index]
if (ch === ' ' && normalScanCount) {
var word = str.substr(index + 1, normalScanCount)
tempArr.push(word)
normalScanCount = 0
} else {
normalScanCount++
if (index === 0) {
tempArr.push(str.substr(0, normalScanCount))
}
}
}
console.log(tempArr.join(' '))
}