#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << '{';
  string sep;
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << '{';
  string sep;
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &v) {
  os << '{';
  string sep;
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
void dbg_out() { cerr << " "; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < s.size();) {
    if (s[i] == 'o') {
      bool f = 0;
      while (i + 2 < s.size()) {
        if (s[i + 1] == 'g' and s[i + 2] == 'o') {
          f = 1;
          i += 2;
        } else
          break;
      }
      if (f) {
        cout << "***";
        i++;
      } else {
        cout << "o";
        i++;
      }
    } else {
      cout << s[i];
      i++;
    }
  }
  return 0;
}
