#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, flag, j = 0, count, k = 0;
  char in[105], out[105];
  scanf("%lld", &n);
  scanf(" %s", in);
  for (i = 0; i < (n - 2); i++) {
    flag = 0;
    if (in[i] == 'o' && in[i + 1] == 'g' && in[i + 2] == 'o') {
      flag = 1;
      count = 0;
      for (j = i + 3; j < (n - 1); j += 2) {
        if (!(in[j] == 'g' && in[j + 1] == 'o')) {
          break;
        }
        count++;
      }
    }
    if (flag) {
      out[k++] = '*';
      out[k++] = '*';
      out[k++] = '*';
      i += 2 + (count * 2);
    } else {
      out[k++] = in[i];
    }
  }
  for (; i < n; i++) {
    out[k++] = in[i];
  }
  out[k] = '\0';
  printf("%s\n", out);
  return 0;
}
