#include <bits/stdc++.h>
using namespace std;
const long long prime = 1e9 + 7;
int main() {
  int n, i = 0;
  string s, t;
  cin >> n >> s;
  while (i < n) {
    if (s.substr(i, 3) == "ogo") {
      t += "***";
      while (s.substr(i, 3) == "ogo") {
        i += 2;
      }
    } else {
      t += s[i];
    }
    i++;
  }
  cout << t;
}
