#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16777216")
const int inf = 0x3f3f3f3f;
const string debug_line = "yolo";
const double PI = 4 * atan(1);
vector<pair<pair<int, int>, int> > Q1;
map<int, double> dp;
map<int, double> num;
double tryall(int u, double maxa) {
  if (dp[u] <= maxa) {
    return maxa;
  } else {
    return (tryall(2 * u, max(maxa, num[u] + dp[2 * u + 1])) +
            tryall(2 * u + 1, max(maxa, num[u] + dp[2 * u]))) /
           2.0;
  }
}
int main() {
  int h, q;
  scanf("%d%d", &h, &q);
  for (int(i) = (0); (i) < (q); ++(i)) {
    char type[5];
    scanf("%s", type);
    if (type[0] == 'a') {
      int v, e;
      scanf("%d%d", &v, &e);
      num[v] += e;
      while (v != 0) {
        dp[v] += e;
        v = v / 2;
      }
    } else if (type[0] == 'd') {
      double answer1 = tryall(1, 0);
      printf("%.6lf\n", answer1);
    }
  }
  return 0;
}
