#include #include #include #include #include #include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) #define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x) typedef long long ll; using namespace std; int main() { int n; ll x; cin >> n >> x; vector a(n); repeat (i,n) cin >> a[i]; vector rank(n); whole(iota, rank, 0); whole(sort, rank, [&](int i, int j) { return a[i] < a[j]; }); const ll limit = 1e5; unordered_map > low; low[0] = vector(); int i = 0; for (; i < n and a[rank[i]] < limit; ++ i) { unordered_map > prv = low; for (auto & it : prv) { it.second.push_back(rank[i]); low[it.first + a[rank[i]]] = it.second; } } vector high; ll acc = 0; function dfs = [&](int i) { if (i >= n) return false; if (dfs(i+1)) return true; acc += a[rank[i]]; high.push_back(rank[i]); if (low.count(x - acc)) return true; if (dfs(i+1)) return true; high.pop_back(); acc -= a[rank[i]]; return false; }; if (low.count(x) or dfs(i)) { string ans(n, 'x'); for (int j : low[x - acc]) ans[j] = 'o'; for (int j : high) ans[j] = 'o'; cout << ans << endl; } else { cout << "No" << endl; } return 0; }