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