#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
struct read {
  char s[10];
  int x, z;
} a[100005];
int n, N, m, w, r[100005], c[100005];
map<int, int> disc;
int cov(int z) {
  int ret = 1;
  bool flag = false;
  for (int i = 30, j = N; i >= 0; i--, j >>= (flag)) {
    if (flag) {
      if (z & (1 << i))
        ret += j + 1;
      else
        ret++;
    }
    if (z & (1 << i)) flag = true;
  }
  return ret;
}
void add(int x, int a) {
  for (int i = x; i <= w; i += i & (-i)) c[i] += a;
}
int bin_r(int z) {
  if (r[w] < z) return inf;
  int mi = 1, mid, ma = w;
  while (mi < ma) {
    mid = (mi + ma) >> 1;
    if (r[mid] >= z)
      ma = mid;
    else
      mi = mid + 1;
  }
  return mi;
}
int bin_l(int z) {
  if (r[1] > z) return -inf;
  int mi = 1, mid, ma = w;
  while (mi < ma) {
    mid = (mi + ma + 1) >> 1;
    if (r[mid] <= z)
      mi = mid;
    else
      ma = mid - 1;
  }
  return mi;
}
int bit_sum(int x) {
  int ret = 0;
  for (int i = x; i > 0; i -= i & (-i)) ret += c[i];
  return ret;
}
int sum(int x, int y) {
  x = bin_r(x);
  y = bin_l(y);
  if (x > y) return 0;
  return bit_sum(y) - bit_sum(x - 1);
}
double dfs(int z, int N, double p, int ma) {
  N >>= 1;
  if (N == 0) return p * max(ma, sum(z, z));
  p /= 2.0;
  double ret = 0;
  int t1 = sum(z, z);
  int t2 = sum(z + 1, z + N);
  int t3 = sum(z + N + 1, z + N + N);
  if (t2 <= t1 + t3)
    ret += p * max(ma, t1 + t3);
  else
    ret += dfs(z + 1, N, p, max(ma, t1 + t3));
  if (t1 + t2 >= t3)
    ret += p * max(ma, t1 + t2);
  else
    ret += dfs(z + N + 1, N, p, max(ma, t1 + t2));
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  N = (int)((1LL << (n + 1)) - 1);
  for (int i = 0; i < m; i++) {
    scanf("%s", a[i].s);
    if (a[i].s[0] == 'a') {
      scanf("%d%d", &a[i].x, &a[i].z);
      a[i].x = cov(a[i].x);
      disc[a[i].x] = -1;
    }
  }
  w = 0;
  for (map<int, int>::iterator i = disc.begin(), j = disc.end(); i != j; i++) {
    i->second = ++w;
    r[i->second] = i->first;
  }
  memset(c, 0, sizeof(c));
  for (int i = 0; i < m; i++) {
    if (a[i].s[0] == 'a') {
      a[i].x = disc[a[i].x];
      add(a[i].x, a[i].z);
    } else
      printf("%f\n", dfs(1, N, 1, 0));
  }
  return 0;
}
