#include <bits/stdc++.h>
using namespace std;
struct Node {
  int left, right, sum;
} tree[100005 * 30];
int h, q, num;
int main() {
  char str[10];
  int i, j, k;
  int path[35];
  scanf("%d%d", &h, &q);
  num = 2;
  while (q--) {
    scanf("%s", str);
    if (str[0] == 'a') {
      scanf("%d%d", &i, &j);
      k = 0;
      while (i >= 1) {
        path[k++] = i;
        i /= 2;
      }
      for (i = k - 2, k = 1; i >= 0; i--) {
        tree[k].sum += j;
        if (path[i] % 2) {
          if (!tree[k].right) tree[k].right = num++;
          k = tree[k].right;
        } else {
          if (!tree[k].left) tree[k].left = num++;
          k = tree[k].left;
        }
      }
      tree[k].sum += j;
    } else {
      double ans = 0, p = 1.0;
      int maxval = 0, cur;
      k = 1;
      while (k) {
        p *= 0.5;
        i = tree[tree[k].left].sum;
        j = tree[tree[k].right].sum;
        cur = tree[k].sum - i - j;
        ans += ((maxval) > (((i) > (j) ? (i) : (j)) + cur)
                    ? (maxval)
                    : (((i) > (j) ? (i) : (j)) + cur)) *
               p;
        if (i > j)
          k = tree[k].left;
        else
          k = tree[k].right;
        maxval = ((maxval) > (((i) > (j) ? (j) : (i)) + cur)
                      ? (maxval)
                      : (((i) > (j) ? (j) : (i)) + cur));
      }
      ans += maxval * p;
      printf("%.9lf\n", ans);
    }
  }
  return 0;
}
