#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> splitString(const string& str, char delimiter) {
vector<string> substrings;
size_t start = 0;
size_t end = str.find(delimiter);
while (end != string::npos) {
substrings.push_back(str.substr(start, end - start));
start = end + 1;
end = str.find(delimiter, start);
}
substrings.push_back(str.substr(start));
return substrings;
}
int main() {
string namesLine, greeting;
getline(cin, namesLine); // 讀取人名
getline(cin, greeting); // 讀取問候語
vector<string> names = splitString(namesLine, ' ');
// 對每個人名進行問候
for (const string& name : names) {
cout << greeting << ", " << name << endl;
}
return 0;
}