#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  string second;
  cin >> second;
  for (int i = 0; i < (int)n; i++) {
    if (i < n - 2 && second[i] == 'o' && second[i + 1] == 'g' &&
        second[i + 2] == 'o') {
      cout << "***";
      int j = i + 3;
      bool flag = false;
      while (j < n - 1) {
        if (second[j] == 'g' && second[j + 1] == 'o') {
          flag = true;
          j += 2;
        } else
          break;
      }
      i = j - 1;
    } else {
      cout << second[i];
    }
  }
}
