import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.TreeSet;
import java.lang.Integer;
public class boxes_kp_java {
static int nextInt() {
try {
st.nextToken();
return (int) st.nval;
return 0;
}
}
public static void main
(String[] args
) { int n = nextInt();
int m = 0;
int k, a;
for (int i = 0; i < n; i++) {
k = nextInt();
a = nextInt();
int tm = k + 1;
if (a > 1) {
int p = 0;
int v = 1;
while (v < a) {
v *= 4;
p++;
}
tm = p + k;
}
}
}
}
CmltcG9ydCBqYXZhLmlvLkJ1ZmZlcmVkUmVhZGVyOwppbXBvcnQgamF2YS5pby5JT0V4Y2VwdGlvbjsKaW1wb3J0IGphdmEuaW8uSW5wdXRTdHJlYW1SZWFkZXI7CmltcG9ydCBqYXZhLmlvLlN0cmVhbVRva2VuaXplcjsKaW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CmltcG9ydCBqYXZhLnV0aWwuQ29sbGVjdGlvbnM7CmltcG9ydCBqYXZhLnV0aWwuSXRlcmF0b3I7CmltcG9ydCBqYXZhLnV0aWwuVHJlZVNldDsKaW1wb3J0IGphdmEubGFuZy5JbnRlZ2VyOwoKcHVibGljIGNsYXNzIGJveGVzX2twX2phdmEgewoKICAgIHN0YXRpYyBTdHJlYW1Ub2tlbml6ZXIgc3QgPSBuZXcgU3RyZWFtVG9rZW5pemVyKG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtLmluKSkpOwoKICAgIHN0YXRpYyBpbnQgbmV4dEludCgpIHsKICAgICAgICB0cnkgewogICAgICAgICAgICBzdC5uZXh0VG9rZW4oKTsKICAgICAgICAgICAgcmV0dXJuIChpbnQpIHN0Lm52YWw7CiAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgfQogICAgfQoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBpbnQgbiA9IG5leHRJbnQoKTsKICAgICAgICBpbnQgbSA9IDA7CiAgICAgICAgaW50IGssIGE7CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgayA9IG5leHRJbnQoKTsKICAgICAgICAgICAgYSA9IG5leHRJbnQoKTsKICAgICAgICAgICAgaW50IHRtID0gayArIDE7CiAgICAgICAgICAgIGlmIChhID4gMSkgewogICAgICAgICAgICAgICAgaW50IHAgPSAwOwogICAgICAgICAgICAgICAgaW50IHYgPSAxOwogICAgICAgICAgICAgICAgd2hpbGUgKHYgPCBhKSB7CiAgICAgICAgICAgICAgICAgICAgdiAqPSA0OwogICAgICAgICAgICAgICAgICAgIHArKzsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB0bSA9IHAgKyBrOwogICAgICAgICAgICB9CiAgICAgICAgICAgIG0gPSBNYXRoLm1heChtLCB0bSk7CgogICAgICAgIH0KICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4obSk7CiAgICB9Cn0K