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