#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<char> a(n);
  for (int i = 0; i < n; i++) {
    scanf(" %c", &a[i]);
  }
  vector<char> b = a;
  for (int i = 0; i < n; i++) {
    if (i + 2 < (int)a.size() && a[i] == 'o' && a[i + 1] == 'g' &&
        a[i + 2] == 'o') {
      a[i] = '*';
      a[i + 1] = '*';
      a[i + 2] = '*';
      for (int j = i + 3; j + 1 < (int)a.size(); j += 2) {
        if (j + 1 >= (int)a.size()) {
          break;
        }
        if (a[j] == 'g' && a[j + 1] == 'o') {
          a.erase(a.begin() + j, a.begin() + j + 2);
          j -= 2;
        } else {
          break;
        }
      }
      i += 2;
    }
  }
  for (int i = 0; i < (int)a.size(); i++) {
    printf("%c", a[i]);
  }
}
