#include <bits/stdc++.h>
using namespace std;
const int maxx = 2e5 + 19;
int n, m, a, c[maxx], b, ans, jvb, sum, z, x, y, k, minn = 99999999;
string s, t, w;
bool flag = false, hp = false;
vector<long long> va, vb;
char ch[20][20];
void Input() {
  cin >> n;
  cin >> s;
}
void Solve() {
  s += "000";
  for (int i = 0; i < n; i++) {
    if (s[i] == 'o' and s[i + 1] == 'g' and s[i + 2] == 'o') {
      s[i] = '*';
      s[i + 1] = '*';
      s[i + 2] = '*';
      i += 3;
      while (1) {
        if (s[i] == 'g' and s[i + 1] == 'o') {
          s.erase(i, 2);
          continue;
        } else {
          i--;
          break;
        }
      }
    }
  }
  s.erase(s.size() - 3, 3);
  cout << s << endl;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  Input(), Solve();
  return 0;
}
