```
class Solution {
public:
vector<vector<int>> findSubsequences(vector<int>& a) {
set<vector<int>> seqs = {vector<int>(0)};
for (int i = 0; i < a.size(); i++) {
vector<vector<int>> built(seqs.size());
std::copy(seqs.begin(), seqs.end(), built.begin());
for (auto seq : built) {
if (seq.empty() || a[i] >= seq.back()) {
seq.push_back(a[i]);
seqs.insert(seq);
}
}
}
vector<vector<int>> res;
for (auto seq : seqs)
if (seq.size() > 1) res.push_back(seq);
return res;
}
};
```