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