#include <bits/stdc++.h>
using namespace std;
bool isPal(string);
bool ispar(char);
string solve();
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  string ans = "";
  bool ogo = false;
  for (int i = 0; i < str.size(); i++) {
    if (i <= str.size() - 3 && str[i] == 'o' && str[i + 1] == 'g' &&
        str[i + 2] == 'o') {
      ogo = true;
      ans += "***";
      i += 2;
    } else if (ogo && i <= str.size() - 2 && str[i] == 'g' &&
               str[i + 1] == 'o') {
      i += 1;
    } else {
      ogo = false;
      ans += str[i];
    }
  }
  cout << ans;
  return 0;
}
