#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  while (true) {
    bool was = 0;
    for (int i = 0; i <= (int)str.size() - 3; i++) {
      if (str.substr(i, 3) == "ogo") {
        str.erase(i, 3);
        while (i < str.size() && str.substr(i, 2) == "go") str.erase(i, 2);
        str.insert(i, "***");
        was = 1;
        break;
      }
    }
    if (!was) break;
  }
  cout << str << "\n";
  return 0;
}
