#include<iostream>
#include<vector>using namespace std;//字符分割函数
//把字符串中的字符c剔除 同时将字符串中的其他内容以合适的类型保存
vector<int> split(string str_input, char c)
{vector<int> result;while(str_input.find(c) != -1){//找到分割字符的位置int pos_index = str_input.find(c);// cout<<"pos_index:"<<pos_index<<endl;string str_tmp = str_input.substr(0, pos_index);//cout<<"str_tmp:"<<str_tmp<<endl;int digital = stoi(str_tmp);result.push_back(digital);str_input = str_input.substr(pos_index+1);// cout<<"str_input:"<<str_input<<endl;}int digital = stoi(str_input);result.push_back(digital);return result;
}int main()
{string input_str;getline(cin, input_str);//分隔符是空格vector<int> tmp2 = split(input_str, ' ');int count = 0;//用双倍空间解决了循环问题vector<int> nums = vector<int>(tmp2.size()*2, 0);for (int i = 0; i < tmp2.size(); i++) { nums[i] = tmp2[i];nums[i+tmp2.size()] = tmp2[i];count += 2;}vector<int> result = vector<int>(tmp2.size(), 0);for (int i = 0; i < tmp2.size(); i++) { //cout<<" "<<nums[i]<<" "<<endl;if(nums[i+1]<nums[i]){result[i] = nums[i]+ nums[i+1];}else {result[i] = nums[i];}cout<<result[i]<<" ";}cout<<endl;return 0;
}