#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
map<int, double> tree;
char str[2001];
int h, q, x, y;
double gao(int k, double p) {
  int tk = tree[k];
  if (tk <= p) return p;
  return 0.5 * ((gao(k << 1, max(p, tk - tree[k << 1]))) +
                (gao(k << 1 | 1, max(p, tk - tree[k << 1 | 1]))));
}
int main() {
  scanf("%d%d", &h, &q);
  while (q--) {
    scanf("%s", str);
    if (str[0] == 'a') {
      scanf("%d%d", &x, &y);
      while (x) {
        tree[x] += y;
        x >>= 1;
      }
    } else
      printf("%.10f\n", gao(1, 0));
  }
}
