#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[105];
  int n, i;
  cin >> n;
  for (i = 0; i < n; i++) cin >> str[i];
  str[i] = '\0';
  int len = strlen(str), flag = 0;
  for (int i = 0; i < len; i++) {
    flag = 0;
    do {
      while (str[i] == 'o' && str[i + 1] == 'g' && str[i + 2] == 'o') {
        flag = 1;
        i = i + 2;
      }
      if (flag == 1) {
        printf("***");
        i++;
      }
    } while (str[i] == 'o' && str[i + 1] == 'g' && str[i + 2] == 'o');
    if (i >= len) break;
    printf("%c", str[i]);
  }
  printf("\n");
  return 0;
}
