#include <bits/stdc++.h>
using namespace std;
int main(void) {
  vector<char> v;
  int n;
  bool flag = false;
  cin >> n;
  v.resize(n + 1);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 1; i < n; i++) {
    if (v[i] == 'g' && v[i - 1] == 'o' && v[i + 1] == 'o') {
      flag = true;
      v[i] = '*';
      v[i - 1] = '*';
      v[i + 1] = '*';
      i += 2;
    }
    while (flag) {
      if (flag && i < v.size())
        if (v[i] == 'g' && v[i + 1] == 'o') {
          v[i] = '#';
          v[i + 1] = '#';
          i += 2;
        } else
          flag = false;
    }
  }
  for (int i = 0; i < n; i++)
    if (v[i] != '#') cout << v[i];
  cout << endl;
  return 0;
}
