#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> A;
unordered_map<int, int> B;
int main() {
  int H, Q;
  scanf("%d%d", &H, &Q);
  char s[10];
  while (Q--) {
    scanf("%s", s);
    if (s[0] == 'a') {
      int x, y;
      scanf("%d%d", &x, &y);
      B[x] += y;
      for (; x; x >>= 1) {
        A[x] += y;
      }
    } else {
      double p = 0.5, ret = 0.0;
      int max_e = 0;
      int v = 1;
      for (int i = 0; i < H; ++i) {
        int L = B[v] + A[2 * v];
        int R = B[v] + A[2 * v + 1];
        ret += p * max(max_e, max(L, R));
        max_e = max(max_e, min(L, R));
        if (L > R)
          v = 2 * v;
        else
          v = 2 * v + 1;
        p /= 2;
      }
      ret += 2 * p * max(max_e, B[v]);
      printf("%.10f\n", ret);
    }
  }
  return 0;
}
