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