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