#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(NULL);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  string result = "";
  int i = 0;
  while (i < int(s.size())) {
    if (i <= int(s.size()) - 3 && s.substr(i, 3) == "ogo") {
      int j = i + 3;
      while (j <= int(s.size()) - 2 && s.substr(j, 2) == "go") {
        j += 2;
      }
      i = j;
      result += "***";
    } else {
      result += s[i];
      i++;
    }
  }
  cout << result;
  return 0;
}
