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