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