#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return (a < b); }
int max(int a, int b) {
  if (a > b) return a;
  return b;
}
int min(int a, int b) {
  if (a < b) return a;
  return b;
}
long long power(long long a, int x) {
  while (x--) {
    a *= a;
  }
  return a;
}
int main() {
  int n, i = 0, x;
  cin >> n;
  string s, c;
  cin >> s;
  while (i < n) {
    x = i;
    if (s[i] == 'o')
      while (s[i + 1] == 'g' && s[i + 2] == 'o') i += 2;
    if (x < i)
      c += "***";
    else
      c += s[i];
    i++;
  }
  cout << c;
}
