#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
const long long SZ = 1e5 + 7;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
const long long MOD = 998244353;
const long double PI = 3.1415926535897932384;
void __print(int x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << x; }
void __print(const char *x) { cerr << x; }
void __print(const string &x) { cerr << x; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ", ";
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) {
    cerr << (f++ ? ", " : "");
    __print(i);
  }
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) {
    cerr << ", ";
  }
  _print(v...);
}
long long tc_cnt = 1;
auto clk = clock();
mt19937_64 rang(high_resolution_clock::now().time_since_epoch().count());
void run_time() {
  cerr << endl;
  cerr << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
  return;
}
long long int powermod(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    b = b >> 1;
    a = (a * a) % mod;
  }
  return ans;
}
long long int modadd(long long int a, long long int b, long long int m = mod) {
  a = a % m;
  b = b % m;
  return (((a + b) % m) + m) % m;
}
long long int modsub(long long int a, long long int b, long long int m = mod) {
  a = a % m;
  b = b % m;
  return (((a - b) % m) + m) % m;
}
long long int modmul(long long int a, long long int b, long long int m = mod) {
  a = a % m;
  b = b % m;
  return (((a * b) % m) + m) % m;
}
long long int modinv(long long int a, long long int m = mod) {
  return powermod(a, m - 2);
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
bool compare(const pair<long long int, long long int> &a,
             const pair<long long int, long long int> &b) {
  if (a.first == b.first) {
    return a.second < b.second;
  }
  return a.first < b.first;
}
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string ans = "";
  for (long long i = 0; i < (n); i++) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      ans.push_back('*');
      ans.push_back('*');
      ans.push_back('*');
      i += 3;
      while (s[i] == 'g' && s[i + 1] == 'o' && i + 1 < n) {
        i += 2;
      }
      i--;
    } else {
      ans.push_back(s[i]);
    }
  }
  for (long long i = 0; i < (ans.size()); i++) {
    cout << ans[i];
  }
  cout << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cerr << endl;
  { solve(); }
  run_time();
  return 0;
}
