#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s, ans;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      i += 3;
      ans += "***";
      while (i < n) {
        if (s[i] == 'g' && s[i + 1] == 'o') {
          i += 2;
        } else {
          i--;
          break;
        }
      }
    } else {
      ans += s[i];
    }
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
