#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, c;
  string s;
  string ss = "ogo";
  cin >> n;
  cin >> s;
  c = 0;
  for (i = 0; i < n; i++) {
    if (s.substr(i, 3) == ss) {
      c++;
      i++;
    } else {
      if (c > 0) {
        cout << "***";
        c = 0;
      } else {
        cout << s[i];
      }
    }
  }
  cout << endl;
}
