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