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