#include <bits/stdc++.h>
using namespace std;
int H;
map<int, int> cost, sum;
char buf[100];
void add(int v, int e) {
  cost[v] += e;
  while (v >= 1) {
    sum[v] += e;
    v /= 2;
  }
}
double func(int depth, int x, double big) {
  if (depth == H) {
    if (cost.find(x) == cost.end()) return big;
    double ans = cost[x];
    if (big > ans) ans = big;
    return ans;
  } else {
    double cur = cost[x], L = sum[2 * x], R = sum[2 * x + 1];
    double ans1 = max(big, cur + L);
    if (R > cur + L + 0.5 && R > ans1) ans1 = func(depth + 1, 2 * x + 1, ans1);
    double ans2 = max(big, cur + R);
    if (L > cur + R + 0.5 && L > ans2) ans2 = func(depth + 1, 2 * x, ans2);
    return (ans1 + ans2) / 2.0;
  }
}
int main(void) {
  int Q, i, v, e;
  scanf("%d%d", &H, &Q);
  for ((i) = 0; (i) < (int)(Q); (i)++) {
    scanf("%s", buf);
    if (buf[0] == 'a') {
      scanf("%d%d", &v, &e);
      add(v, e);
    } else {
      double ans = func(0, 1, 0.0);
      printf("%.9f\n", ans);
    }
  }
  return 0;
}
