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