#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int p = -1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'o' && s[i + 1] == 'g' && s[i + 2] == 'o') {
      p = i;
      while (s[i + 1] == 'g' && s[i + 2] == 'o' && i < s.size()) i += 2;
      int tar = 3;
      for (int j = i; j >= p; j--, tar--) {
        if (tar > 0)
          s[j] = '*';
        else
          s[j] = '-';
      }
    }
  }
  for (int i = 0; s[i]; i++) {
    if (s[i] != '-') cout << s[i];
  }
  return 0;
}
