#include <bits/stdc++.h>
using namespace std;
void useFileInput() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
void setMyPrecision(int n) { cout << fixed << setprecision(n); }
bool test = 0;
bool fileInput = 0;
void solve() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  string ans = "";
  int i = 0;
  while (i < n) {
    if (str[i] == 'o' && str[i + 1] == 'g' && str[i + 2] == 'o') {
      i += 3;
      while (i < n) {
        if (str[i] == 'g' && str[i + 1] == 'o')
          i += 2;
        else
          break;
      }
      ans += "***";
    } else {
      ans += str[i];
      i++;
    }
  }
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  if (fileInput) useFileInput();
  if (test) {
    int t;
    cin >> t;
    while (t--) solve();
  } else
    solve();
  return 0;
}
