#include <bits/stdc++.h>
using namespace std;
map<long long, int> value, tot;
long long getmax(long long a, long long b) { return a > b ? a : b; }
long long getans(int x, int depth, long long limit) {
  if (tot[x] <= limit) return (1 << depth) * limit;
  if (!depth) return value[x];
  return getans(x * 2, depth - 1, getmax(limit, tot[x * 2 + 1] + value[x])) +
         getans(x * 2 + 1, depth - 1, getmax(limit, tot[x * 2] + value[x]));
}
int main() {
  int n, h;
  scanf("%d%d", &h, &n);
  while (n--) {
    char str[10];
    scanf("%s", str);
    if (str[0] == 'a') {
      int x, y;
      scanf("%d%d", &x, &y);
      value[x] += y;
      while (x) {
        tot[x] += y;
        x >>= 1;
      }
    } else
      printf("%.8lf\n", double(getans(1, h, 0)) / (1 << h));
  }
  return 0;
}
