#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, ans, cnt = 0, j, cnt1 = 0;
  cin >> n;
  string s, p;
  cin >> s;
  for (long long int i = 0; i < s.size();) {
    cnt = 0;
    if (s[i] == 'o') {
      if (i + 1 < s.size() && s[i + 1] == 'g') {
        if (i + 2 < s.size() && s[i + 2] == 'o') {
          p.push_back('*');
          p.push_back('*');
          p.push_back('*');
          cnt++;
          ans = i;
          i = i + 3;
        } else {
          p.push_back(s[i]);
          p.push_back(s[i + 1]);
          i = i + 2;
        }
      } else {
        p.push_back(s[i]);
        i++;
      }
    } else {
      p.push_back(s[i]);
      i++;
    }
    if (cnt > 0) {
      for (j = ans + 3; j < n;) {
        if (j < s.size() && s[j] == 'g') {
          if (j + 1 < s.size() && s[j + 1] == 'o') {
            if (j + 2 < s.size())
              j = j + 2;
            else {
              cnt1++;
              break;
            }
          } else {
            i = j;
            break;
          }
        } else {
          i = j;
          break;
        }
      }
    }
    if (cnt1 > 0) break;
  }
  cout << p << endl;
}
