#include <bits/stdc++.h>
const long long int mx = 1e6 + 5, M = 1e9 + 7;
using namespace std;
long long int a, op;
string s;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cin >> a >> s;
  if (a <= 2) {
    cout << s;
    return 0;
  }
  for (int i = 0; i < s.size() - 2; i++) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      op = -1;
      for (int j = i + 3; j < s.size(); j++) {
        if (s[j] == 'g' && s[j + 1] == 'o') {
          j++;
          op = j;
        } else {
          break;
        }
      }
      s[i] = s[i + 1] = s[i + 2] = '*';
      for (int k = i + 3; k <= op; k++) {
        s[k] = '-';
      }
    }
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != '-') {
      cout << s[i];
    }
  }
  return 0;
}
