#include <bits/stdc++.h>
using namespace std;
int n, q;
char str[10];
map<int, double> sum;
double query(int num, double ret) {
  if (ret >= sum[num]) return ret;
  double left = query(num << 1, max(sum[num] - sum[num << 1], ret));
  double right = query(num << 1 | 1, max(sum[num] - sum[num << 1 | 1], ret));
  return (left + right) / 2.0;
}
int main() {
  sum.clear();
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= q; i++) {
    scanf("%s", str);
    if (str[0] == 'a') {
      int pos, val;
      scanf("%d%d", &pos, &val);
      while (pos >= 1) {
        sum[pos] += val;
        pos >>= 1;
      }
    } else
      printf("%.12f\n", query(1, 0));
  }
  return 0;
}
