#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e6;
struct node {
  int l, r, sum;
} tre[maxn];
int cnt, h;
unordered_map<int, int> val;
void ad(int pos, int v, int &nw, int id) {
  if (!nw) nw = ++cnt;
  tre[nw].sum += v;
  if (pos == id) return;
  if (pos >> (__builtin_clz(id) - __builtin_clz(pos) - 1) & 1)
    ad(pos, v, tre[nw].r, id << 1 | 1);
  else
    ad(pos, v, tre[nw].l, id << 1);
}
double que(int maxn, int &nw, int id) {
  if (!nw) return maxn;
  if (tre[tre[nw].l].sum < tre[tre[nw].r].sum)
    return 0.5 * max(maxn, val[id] + tre[tre[nw].r].sum) +
           0.5 * que(max(maxn, val[id] + tre[tre[nw].l].sum), tre[nw].r,
                     id << 1 | 1);
  else
    return 0.5 * max(maxn, val[id] + tre[tre[nw].l].sum) +
           0.5 *
               que(max(maxn, val[id] + tre[tre[nw].r].sum), tre[nw].l, id << 1);
}
int main() {
  int q, root = 0, v, e;
  char type[10];
  scanf("%d%d", &h, &q);
  while (q--) {
    scanf("%s", type);
    if (type[0] == 'a') {
      scanf("%d%d", &v, &e);
      ad(v, e, root, 1);
      val[v] += e;
    } else
      printf("%.4lf\n", que(0, root, 1));
  }
  return 0;
}
