#include <bits/stdc++.h>
using namespace std;
int n;
string s, res = "";
int FindParasit(int v) {
  if (s[v] != 'o' || s[v + 1] != 'g' || s[v + 2] != 'o') return 1;
  int sum = 3, i = v + 3;
  while (s[i] == 'g' && s[i + 1] == 'o') {
    i += 2;
    sum += 2;
  }
  return sum;
}
void func() {
  int k = 0;
  while (k < n) {
    int c = FindParasit(k);
    if (c == 1)
      res += s[k];
    else
      res += "***";
    k += c;
  }
}
int main() {
  cin >> n >> s;
  func();
  cout << res;
  return 0;
}
