#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int b = 0;
  string ans;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != 'g' && s[i] != 'o')
      ans += s[i];
    else if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      ans += "***";
      i += 2;
    } else if (s[i] == 'g' && s[i - 1] == 'o' && s[i - 2] == 'g' &&
               s[i - 3] == 'o' && s[i + 1] == 'o')
      i++;
    else
      ans += s[i];
  }
  cout << ans;
  return 0;
}
