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