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