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