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