#include <bits/stdc++.h>
using namespace std;
const int N = 3e6 + 7;
map<int, int> f;
int h, q;
void add(int x, int y) {
  while (x > 0) {
    f[x] += y;
    x /= 2;
  }
}
double calc(int x, int y, int r) {
  if (r == h) {
    if (f[x] >= y) return 1.0 * f[x] / (1 << h);
    return 1.0 * y / (1 << h);
  }
  int p = f[x], lc = f[x * 2], rc = f[x * 2 + 1];
  double ans = 0;
  if (lc <= max(y, p - lc))
    ans += 1.0 * max(y, p - lc) / (1 << (r + 1));
  else
    ans += calc(x * 2, max(y, p - lc), r + 1);
  if (rc <= max(y, p - rc))
    ans += 1.0 * max(y, p - rc) / (1 << (r + 1));
  else
    ans += calc(x * 2 + 1, max(y, p - rc), r + 1);
  return ans;
}
int main() {
  scanf("%d%d", &h, &q);
  char cmd[5];
  int x, y;
  for (int i = 0; i < q; i++) {
    scanf("%s", cmd);
    if (cmd[0] == 'a')
      scanf("%d%d", &x, &y), add(x, y);
    else
      printf("%.6lf\n", calc(1, 0, 0));
  }
  return 0;
}
