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