for (int i = 0; i < n; i++) if (s[i] == 'o') { k--; if (i != n - 1) s[i + 1] = '.'; if (i != 0) s[i - 1] = '.'; }
vector<int> res;
for (int i = 0; i < n; i++) { if (s[i] == '?') { int j = i; while (j < n && s[j] == '?') j++; res.push_back(j - i), t += (j - i + 1) / 2, i = j - 1; } }
if (k == 0) { for (int i = 0; i < n; i++) cout << (s[i] == 'o' ? 'o' : '.'); } elseif (t == k) { int idx = 0;
for (int i = 0; i < n; i++) { if (s[i] == '?') { int ttt = res[idx++]; if (ttt & 1) for (int z = 0; z < ttt; z++) cout << ((z & 1) ? '.' : 'o'); else for (int z = 0; z < ttt; z++) cout << "?"; i = i + ttt - 1; } else cout << s[i]; } } else cout << s << endl; }