#include <bits/stdc++.h>
using namespace std;
vector<char> v;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s.substr(i, 3) == "ogo") {
      v.push_back('*');
      v.push_back('*');
      v.push_back('*');
      i += 3;
      while (s.substr(i, 2) == "go") i += 2;
      i--;
    } else
      v.push_back(s[i]);
  }
  for (auto x : v) cout << x;
  return 0;
}
