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