#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline const T MAX(T a, T b) {
  return ((a) > (b) ? (a) : (b));
}
template <typename T>
inline const T MIN(T a, T b) {
  return ((a) > (b) ? (b) : (a));
}
template <typename T>
inline const T ABS(T a) {
  return (((a) > 0) ? (a) : (-(a)));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  int idx = 0;
  string ans;
  while (idx < n) {
    if (s[idx] == 'o' && s[idx + 1] == 'g' && s[idx + 2] == 'o') {
      idx += 3;
      while (s[idx] == 'g' && s[idx + 1] == 'o') idx += 2;
      ans += "***";
    } else {
      ans += s[idx];
      ++idx;
    }
  }
  cout << ans << endl;
  return 0;
}
