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