#include <bits/stdc++.h>
using namespace std;
const int N = 101010 * 31;
int h, q;
int son[N][2], sum[N], cost[N], rt, e;
int main() {
  scanf("%d%d", &h, &q);
  char s[10];
  rt = 1, e = 2;
  for (int re = 0; re < q; ++re) {
    scanf("%s", s);
    if (s[0] == 'a') {
      int x, val;
      scanf("%d%d", &x, &val);
      vector<int> v;
      for (int t = x; t; t >>= 1) v.push_back(t & 1);
      reverse((v).begin(), (v).end());
      int c = rt;
      for (int i = 1; i < (int)(v).size(); ++i) {
        sum[c] += val;
        if (!son[c][v[i]]) son[c][v[i]] = e++;
        c = son[c][v[i]];
      }
      sum[c] += val, cost[c] += val;
    } else {
      double ans = 0;
      int c = rt, Max = 0, rm = 1 << (h);
      for (int dep = 0; dep < h + 1; ++dep) {
        int L = sum[son[c][0]];
        int R = sum[son[c][1]];
        if (L > R + cost[c]) {
          ans += (double)(max(1, rm >> 1)) * max(Max, cost[c] + L);
          Max = max(Max, cost[c] + R);
          c = son[c][0];
        } else {
          ans += (double)(max(1, rm >> 1)) * max(Max, cost[c] + R);
          Max = max(Max, cost[c] + L);
          c = son[c][1];
        }
        rm >>= 1;
      }
      printf("%.10lf\n", (ans) / (1 << h));
    }
  }
  return 0;
}
