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