#include <bits/stdc++.h>
using namespace std;
int main() {
  int tam;
  scanf("%d", &tam);
  string cad, aux = "";
  cin >> cad;
  for (int i = 0; i < tam; i++) {
    while (cad[i] == 'o' && cad[i + 1] == 'g' && cad[i + 2] == 'o') {
      i += 3;
      while (cad[i] == 'g' && cad[i + 1] == 'o') {
        i += 2;
      }
      aux += "***";
    }
    aux += cad[i];
  }
  printf("%s\n", aux.c_str());
  return 0;
}
