#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  regex reg("o(go)+");
  string rep("***");
  string ans = regex_replace(s, reg, rep);
  cout << ans << endl;
  return 0;
}
