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