#include <bits/stdc++.h>
using namespace std;
const int M = 10e9 + 7;
long long bigmod(long long p, long long q, long long m) {
  if (q == 0)
    return 1;
  else if (q % 2 != 0)
    return ((p % m) * bigmod(p, q - 1, m) % m) % m;
  else {
    long long c = bigmod(p, q / 2, m) % m;
    return ((c % m) * (c % m)) % m;
  }
}
bool isprime(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  long long n;
  string a;
  cin >> n;
  cin >> a;
  int i, j;
  for (i = 0; i < n;) {
    if (a[i] == 'o') {
      for (j = i + 1; a[j] == 'g' && a[j + 1] == 'o' && j + 1 < n; j += 2) {
        a[i] = '*';
      }
      if (a[i] == '*') {
        cout << "***";
        i = j;
      } else {
        printf("%c", a[i]);
        i++;
      }
    } else {
      printf("%c", a[i]);
      i++;
    }
  }
  return 0;
}
