#include <bits/stdc++.h>
using namespace std;
long long a[200005];
int D[65], parent[65], edge[65][65];
int main() {
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n;) {
    if (i + 2 < n && s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      putchar('*');
      putchar('*');
      putchar('*');
      i += 3;
      while (i < n && i + 1 < n && s[i] == 'g' && s[i + 1] == 'o') i += 2;
    } else
      putchar(s[i]), i++;
  }
}
