#include <bits/stdc++.h>
using namespace std;
string s;
long long n, i;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cin >> s;
  while (i < n) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      i++;
      while (s[i] == 'g' && s[i + 1] == 'o') {
        i += 2;
      }
      cout << "***";
    } else {
      cout << s[i];
      i++;
    }
  }
  cout << "\n";
  return 0;
}
