#include <iostream>
#include <string>
using namespace std;

class MyString
{
    std::string value;
    
public:
    MyString& operator,(const string& c)
    {
        value += c + ' ';
        return *this;
    }

    friend ostream& operator<<(ostream& o, const MyString& s)
    {
        o << s.value;
        return o;
    }
};

int main()
{
    cout << (MyString(), "hi", "codeisc", "!") << endl;
    cout << (MyString(), "hi", "codeisc", '?', "oh no! what happened?") << endl;

    cin.get();
    return 0;
}