#include <bits/stdc++.h>
using namespace std;
const int INFint = 2e9;
const long long INF = 2e18;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  string ans;
  for (int i = 0; i < n;) {
    if (0) cerr << i << endl;
    if (i + 2 < n && s.substr(i, 3) == "ogo") {
      int it = i + 3;
      while (it + 1 < n) {
        if (s[it] == 'g' && s[it + 1] == 'o') {
          it += 2;
        } else
          break;
      }
      i = it;
      ans += "***";
    } else {
      ans += s[i];
      i++;
    }
  }
  cout << ans;
  fprintf(stderr, "\nTIME = %lf\n", 1.0 * clock() / CLOCKS_PER_SEC);
  ;
  return 0;
}
