#include <bits/stdc++.h>
using namespace std;
char vis[2005][2005];
vector<long long> ans;
vector<pair<long long, long long>> temp;
vector<long long> temp1;
vector<long long> temp2;
long long a[5000005];
long long k, t, s;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      long long j = i + 3;
      long long k = i + 4;
      while (s[j] == 'g' && s[k] == 'o') {
        j += 2;
        k += 2;
      }
      if (j != i + 3)
        i = j - 1;
      else
        i = i + 2;
      cout << "***";
    } else {
      cout << s[i];
    }
  }
  return 0;
}
