#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
unordered_map<int, int> sum;
int h, q;
double getdp(int v, int rest) {
  if (v >= (1 << h)) return max(rest, sum[v]);
  if (rest >= sum[v]) return rest;
  return 0.5 * (getdp(v << 1, max(rest, sum[v] - sum[v << 1])) +
                getdp(v << 1 | 1, max(rest, sum[v] - sum[v << 1 | 1])));
}
int main() {
  scanf("%d%d", &h, &q);
  for (int i = 1; i <= q; ++i) {
    string ty;
    cin >> ty;
    if (ty[0] == 'a') {
      int v, c;
      scanf("%d%d", &v, &c);
      while (v) {
        sum[v] += c;
        v >>= 1;
      }
    } else {
      printf("%.10f\n", getdp(1, 0));
    }
  }
  return 0;
}
