#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  string s;
  cin >> s;
  for (i = 0; i + 2 < s.size(); i++) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      int count = 3;
      while (i + count + 1 < s.size() && s[i + count] == 'g' &&
             s[i + count + 1] == 'o')
        count += 2;
      if (i + count < s.size())
        s = s.substr(0, i) + "***" + s.substr(i + count);
      else
        s = s.substr(0, i) + "***";
    }
  }
  cout << s << endl;
  return 0;
}
