#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535;
const double eps = 1e-6;
int n, m, a1, a2;
char s[10];
map<int, int> S;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf(" %s", &s);
    if (s[0] == 'a') {
      scanf("%d%d", &a1, &a2);
      while (a1) {
        S[a1] += a2;
        a1 /= 2;
      }
    } else {
      int now = 1, ma = 0;
      double p = 1, ans = 0;
      while (1) {
        if (S[now] <= ma) {
          ans += ma * p;
          break;
        }
        p *= 0.5;
        if (S[now * 2] > S[now * 2 + 1]) {
          ans += p * max(S[now] - S[now * 2 + 1], ma);
          ma = max(ma, S[now] - S[now * 2]);
          now = now * 2;
        } else if (S[now * 2] < S[now * 2 + 1]) {
          ans += p * max(S[now] - S[now * 2], ma);
          ma = max(ma, S[now] - S[now * 2 + 1]);
          now = now * 2 + 1;
        } else {
          ans += p * 2 * max(S[now] - S[now * 2], ma);
          break;
        }
      }
      printf("%.5f\n", ans);
    }
  }
}
