class OrderedStream {
public:
string str[1010];
int len,ptr;
OrderedStream(int n) {
ptr=1,len=n;
}
vector<string> insert(int idKey, string value) {
str[idKey]=value;
vector<string> res;
while(str[ptr]!=""&&ptr<=len)
res.push_back(str[ptr++]);
return res;
}
};
/**
* Your OrderedStream object will be instantiated and called as such:
* OrderedStream* obj = new OrderedStream(n);
* vector<string> param_1 = obj->insert(idKey,value);
*/