#include <bits/stdc++.h>
using namespace std;
long long int __xor(long long int a, long long int b) { return a ^ b; }
long long int __and(long long int a, long long int b) { return a & b; }
long long int __or(long long int a, long long int b) { return a | b; }
long long int ai[1000], pi[1000];
int main() {
  long long int b, c, x, y, z, t, i, j, k, l1, l2, m, n, c1 = 0, c2 = 0, q,
                                                         f = 0;
  scanf("%lld", &n);
  string str;
  cin >> str;
  for (i = 0; i < str.length();) {
    if (str[i] == 'o' && str[i + 1] == 'g' && str[i + 2] == 'o') {
      cout << "***";
      f = 1;
      i += 3;
    } else if (str[i] == 'g' && str[i + 1] == 'o' && f == 1) {
      i += 2;
    } else {
      cout << str[i];
      f = 0;
      i++;
    }
  }
  return 0;
}
