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