#include <bits/stdc++.h>
using namespace std;
int h;
map<int, int> mp, freq;
void insert(int v, int e) {
  freq[v] += e;
  for (; v; v >>= 1) mp[v] += e;
}
long double query(int u, int mx) {
  if (mp[u * 2] >= mp[u * 2 + 1]) {
    if (!mp[u * 2]) return max(mx, freq[u]);
    return 0.5 * (max(mx, mp[u * 2] + freq[u]) +
                  query(u * 2, max(mx, mp[u * 2 + 1] + freq[u])));
  } else {
    return 0.5 * (max(mx, mp[u * 2 + 1] + freq[u]) +
                  query(u * 2 + 1, max(mx, mp[u * 2] + freq[u])));
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> h >> q;
  for (int i = (1); i <= (q); i++) {
    string S;
    cin >> S;
    if (S[0] == 'a') {
      int v, e;
      cin >> v >> e;
      insert(v, e);
    } else {
      printf("%.4Lf\n", query(1, 0));
    }
  }
  return 0;
}
