#include #ifdef DEBUG #include #else #define dump(...) ((void)0) #endif template bool chmin(T &a, const U &b){ return (a > b ? a = b, true : false); } template bool chmax(T &a, const U &b){ return (a < b ? a = b, true : false); } template void fill_array(T (&a)[N], const U &v){ std::fill((U*)a, (U*)(a + N), v); } template auto make_vector(const std::array &a, T value = T()){ static_assert(I >= 1); static_assert(N >= 1); if constexpr (I == 1){ return std::vector(a[N - I], value); }else{ return std::vector(a[N - I], make_vector(a, value)); } } template std::ostream& operator<<(std::ostream &s, const std::vector &a){ for(auto it = a.begin(); it != a.end(); ++it){ if(it != a.begin()) s << " "; s << *it; } return s; } template std::istream& operator>>(std::istream &s, std::vector &a){ for(auto &x : a) s >> x; return s; } std::string YesNo(bool value){return value ? "Yes" : "No";} std::string YESNO(bool value){return value ? "YES" : "NO";} std::string yesno(bool value){return value ? "yes" : "no";} template void putl(const T &value){ std::cout << value << "\n"; } template void putl(const Head head, const Tail &... tail){ std::cout << head << " "; putl(tail ...); } namespace haar_lib { class integer_set { std::map data_; using citer = typename std::map::const_iterator; std::optional get_interval(int64_t x) const { if(data_.empty()) return std::nullopt; auto next = data_.lower_bound(x); if(next == data_.end()){ auto prev = std::prev(next); if(x <= prev->second) return {prev}; return std::nullopt; } if(next->first == x) return {next}; if(next == data_.begin()) return std::nullopt; auto prev = std::prev(next); if(x <= prev->second) return {prev}; return std::nullopt; } public: integer_set(){} bool contains(int64_t x) const { return (bool)get_interval(x); } void add(int64_t x){ if(data_.empty()){ data_[x] = x; return; } auto next = data_.lower_bound(x); if(next == data_.end()){ auto prev = std::prev(next); if(x <= prev->second) return; if(prev->second + 1 == x){ prev->second = x; }else{ data_[x] = x; } return; } if(next->first == x) return; if(next == data_.begin()){ if(x + 1 == next->first){ auto t = next->second; data_.erase(next); data_[x] = t; }else{ data_[x] = x; } return; } auto prev = std::prev(next); if(x <= prev->second) return; if(prev->second + 1 == x){ prev->second = x; if(prev->second + 1 == next->first){ prev->second = next->second; data_.erase(next); } }else if(x + 1 == next->first){ auto t = next->second; data_.erase(next); data_[x] = t; }else{ data_[x] = x; } return; } void erase(int64_t x){ const auto res = get_interval(x); if(res){ const auto it = res.value(); const auto [l, r] = *it; data_.erase(it); if(l <= x - 1) data_[l] = x - 1; if(x + 1 <= r) data_[x + 1] = r; } } int64_t mex(int64_t x) const { auto res = get_interval(x); if(res) return (*res)->second + 1; return x; } }; }; namespace haar_lib { template std::string join(Iter first, Iter last, std::string delim = " "){ std::stringstream s; for(auto it = first; it != last; ++it){ if(it != first) s << delim; s << *it; } return s.str(); } } namespace haar_lib {} namespace solver { using namespace haar_lib; constexpr int m1000000007 = 1000000007; constexpr int m998244353 = 998244353; void init(){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(12); std::cerr << std::fixed << std::setprecision(12); std::cin.exceptions(std::ios_base::failbit); } void solve(){ int N, K; std::cin >> N >> K; std::string S; std::cin >> S; std::vector danger(N + 1); for(int i = 1; i <= N - 1; ++i){ danger[i] = S[i - 1] == 'x'; } danger[N] = true; dump(danger); std::vector g(N + 1); integer_set iset; std::map count; for(int i = N; i >= 0; --i){ if(i + K + 1 <= N){ count[g[i + K + 1]] -= 1; if(count[g[i + K + 1]] == 0){ iset.erase(g[i + K + 1]); } } if(danger[i]){ g[i] = 0; }else{ g[i] = iset.mex(0); } iset.add(g[i]); count[g[i]] += 1; } dump(g); std::vector ans; for(int i = 1; i <= K; ++i){ if(g[i + 1] == 0) ans.push_back(i); } if(ans.empty()){ std::cout << 0 << "\n"; }else{ std::cout << join(ans.begin(), ans.end()) << "\n"; } } } int main(){ solver::init(); while(true){ try{ solver::solve(); std::cout << std::flush; std::cerr << std::flush; }catch(const std::istream::failure &e){ break; }catch(...){ break; } } return 0; }