#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, i, f = 0, j, p = 0;
  cin >> n;
  string s;
  cin >> s;
  l = s.length();
  for (i = 0; i < l; i++) {
    if (s[i] == 'o') {
      f = 0;
      for (j = i + 1; j < l; j = j + 2) {
        if (s[j] == 'g' && s[j + 1] == 'o') {
          f = 1;
        } else {
          break;
        }
      }
      if (f == 0)
        cout << s[i];
      else
        cout << "***";
      i = j - 1;
    } else {
      cout << s[i];
    }
  }
}
