#include <bits/stdc++.h>
using namespace std;
int h, q;
map<int, int> sum;
double calc(int v, double lower) {
  if (sum[v] <= lower) return lower;
  if (v & (1 << h)) return max(lower, (double)sum[v]);
  double res = 0;
  for (int i = 0; i < 2; i++)
    res += calc(2 * v + i, max(lower, (double)sum[v] - sum[2 * v + i]));
  return 0.5 * res;
}
int main() {
  while (cin >> h >> q) {
    sum.clear();
    for (int Q = 0; Q < q; Q++) {
      char com[10];
      scanf("%s", com);
      if (com[0] == 'a') {
        int idx, e;
        scanf("%d %d", &idx, &e);
        for (int i = idx; i > 0; i /= 2) sum[i] += e;
      } else {
        printf("%.8lf\n", calc(1, 0));
      }
    }
  }
}
