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