#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char s[150];
  cin >> n >> s;
  int j = 0;
  for (int i = 0; i < n; i++, j = i) {
    if (s[i] == 'o')
      while (s[i + 1] == 'g' && s[i + 2] == 'o') i += 2;
    if (j < i)
      cout << "***";
    else
      cout << s[i];
  }
  cout << endl;
  return 0;
}
