#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
char op[30];
int h, q;
double calc(int i, int d, int s, double p) {
  if (d == h) {
    return max(mp.count(i) ? mp[i] : 0, s) * p;
  }
  int ts = mp.count(i) ? mp[i] : 0;
  int ls = mp.count(i * 2) ? mp[i * 2] : 0;
  int rs = mp.count(i * 2 + 1) ? mp[i * 2 + 1] : 0;
  if (ts <= s) {
    return s * p;
  }
  return calc(i * 2, d + 1, max(s, ts - ls), p * .5) +
         calc(i * 2 + 1, d + 1, max(s, ts - rs), p * .5);
}
int main() {
  scanf("%d%d", &h, &q);
  for (int i = 0; i < q; ++i) {
    scanf("%s", op);
    if (op[0] == 'a') {
      int x, y;
      scanf("%d%d", &x, &y);
      for (; x; x /= 2) {
        mp[x] += y;
      }
    } else {
      printf("%.10f\n", calc(1, 0, 0, 1));
    }
  }
  return 0;
}
