#include <bits/stdc++.h>
char s[200];
int main() {
  int n, i, lim, ind;
  char ch;
  scanf("%d", &n);
  getchar();
  for (i = 0; i < n; i++) {
    ch = getchar();
    s[i] = ch;
  }
  for (i = 0; i < n; i++) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      ind = i + 3;
      while (s[ind] == 'g' && s[ind + 1] == 'o') ind += 2;
      i = ind - 1;
      printf("***");
    } else
      printf("%c", s[i]);
  }
  return 0;
}
