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