#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    char ch[1000];
    cin >> ch;
    int temp = 0;
    for (int i = 0; i < n; i++) {
      if (ch[i] == 'o' && ch[i + 1] == 'g' && ch[i + 2] == 'o' && !temp) {
        if (ch[i + 3] == 'g') {
          int uu = i;
          while (1) {
            if (ch[i] == 'o' && ch[i + 1] == 'g' && ch[i + 2] == 'o') {
              i += 2;
            } else {
              break;
            }
          }
          cout << "***";
        } else {
          i += 2;
          cout << "***";
        }
      } else {
        cout << ch[i];
      }
    }
    cout << endl;
  }
  return 0;
}
