C++ 98%
\nclass OrderedStream {\npublic:\n    OrderedStream(int n) {\n        vec.resize(n);\n    }\n    \n    vector<string> insert(int id, const string& value) {\n   
```\nclass OrderedStream {\npublic:\n    OrderedStream(int n) {\n        vec.resize(n);\n    }\n    \n    vector<string> insert(int id, const string& value) {\n        vec[--id]=value;\n        vector<string> ans;\n        while(pos<vec.size()) {\n            if(vec[pos].empty()) break;\n            ans.push_back(vec[pos++]);\n        }\n        return ans;\n    }\nprivate:\n    vector<string> vec;\n    int pos=0;\n};\n```
['C']