#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<pair<int, int> > ind;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      int l = i;
      while (s[i + 1] == 'g' && s[i + 2] == 'o') {
        i += 2;
      }
      int r = i;
      ind.push_back({l, r});
    }
  }
  int cnt_erased = 0;
  for (int i = 0; i < ind.size(); i++) {
    ind[i].first -= cnt_erased;
    ind[i].second -= cnt_erased;
    for (int j = ind[i].first; j <= ind[i].second; j++) {
      s.erase(s.begin() + ind[i].first);
      cnt_erased++;
    }
    s.insert(ind[i].first, "***");
    cnt_erased -= 3;
  }
  cout << s;
  return 0;
}
