#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char arr[n];
  cin >> arr;
  for (int i = 0; i < n; i++) {
    bool a = false;
    while (arr[i] == 'o' && arr[i + 1] == 'g' && arr[i + 2] == 'o') {
      a = true;
      i += 2;
    }
    if (!a) {
      cout << arr[i];
    } else {
      cout << "***";
    }
  }
}
