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