#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << "\n";
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << "\n";
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << "\n";
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << "\n";
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << "\n";
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << "\n";
}
int arr[200010];
int update[200010];
int main() {
  int n;
  scanf("%d", &n);
  int op;
  int val, pos;
  long long sum = 0, no = 1;
  while (n--) {
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d %d", &pos, &val);
      update[pos - 1] += val;
      sum += (long long)pos * val;
    } else if (op == 2) {
      scanf("%d", &val);
      arr[no] = val;
      sum += val;
      no++;
    } else if (op == 3) {
      no--;
      sum -= update[no] + arr[no];
      update[no - 1] += update[no];
      update[no] = 0;
      arr[no] = 0;
    }
    printf("%.6f\n", (float)sum / no);
  }
  return 0;
}
