#include <bits/stdc++.h>
using namespace std;
string str;
string ans = "";
int main() {
  int len;
  bool sig = false;
  cin >> len;
  cin >> str;
  for (int i = 0; i < str.size(); i++) {
    if (sig == true) {
      if (str[i] == 'g' and str[i + 1] == 'o') {
        i++;
        continue;
      } else {
        sig = false;
      }
    }
    if (str[i] == 'o' and str[i + 1] == 'g' and str[i + 2] == 'o') {
      ans += "***";
      sig = true;
      i += 2;
    } else {
      ans += str[i];
      sig = false;
    }
  }
  cout << ans << endl;
  return 0;
}
