#include <bits/stdc++.h>
using namespace std;
vector<int>searchRange(const vector<int> &A, int B) {
int size = A.size();
int low =0, high = size-1;
int mid;
while(low<=high) {
mid = low + (high-low)/2;
if(A[mid]<B) {
low = mid+1;
}
else high = mid - 1;
}
int positionOne = low;
cout<<positionOne<<endl;
low = 0, high = size - 1;
while(low<=high) {
mid = low + (high-low)/2;
if(A[mid]<=B) {
low = mid+1;
}
else high = mid - 1;
}
int positionTwo = low;
if(A[positionOne] != B) return {-1,-1};
return {A[positionOne],A[positionTwo-1]};
}
int main() {
// your code goes here
vector<int>ans = searchRange({1},1);
cout<<ans[0]<< " "<<ans[1];
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnZlY3RvcjxpbnQ+c2VhcmNoUmFuZ2UoY29uc3QgdmVjdG9yPGludD4gJkEsIGludCBCKSB7CiAgICBpbnQgc2l6ZSA9IEEuc2l6ZSgpOwogICAgaW50IGxvdyA9MCwgaGlnaCA9IHNpemUtMTsKICAgIGludCBtaWQ7CiAgICB3aGlsZShsb3c8PWhpZ2gpIHsKCiAgICBtaWQgPSBsb3cgKyAoaGlnaC1sb3cpLzI7CiAgICAgICAgaWYoQVttaWRdPEIpIHsKICAgICAgICBsb3cgPSBtaWQrMTsKICAgIH0KICAgIGVsc2UgaGlnaCA9IG1pZCAtIDE7CgogICAgfQogICAgaW50IHBvc2l0aW9uT25lICA9IGxvdzsKICAgIGNvdXQ8PHBvc2l0aW9uT25lPDxlbmRsOyAKCiAgICBsb3cgPSAwLCBoaWdoID0gc2l6ZSAtIDE7CgogICAgd2hpbGUobG93PD1oaWdoKSB7CgogICAgbWlkID0gbG93ICsgKGhpZ2gtbG93KS8yOwogICAgICAgIGlmKEFbbWlkXTw9QikgewogICAgICAgIGxvdyA9IG1pZCsxOwogICAgfQogICAgZWxzZSBoaWdoID0gbWlkIC0gMTsKCiAgICB9CgogICAgaW50IHBvc2l0aW9uVHdvID0gbG93OwoKICAgIGlmKEFbcG9zaXRpb25PbmVdICE9IEIpIHJldHVybiB7LTEsLTF9OwogICAgcmV0dXJuIHtBW3Bvc2l0aW9uT25lXSxBW3Bvc2l0aW9uVHdvLTFdfTsKCn0KCmludCBtYWluKCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJdmVjdG9yPGludD5hbnMgPSBzZWFyY2hSYW5nZSh7MX0sMSk7Cgljb3V0PDxhbnNbMF08PCAiICI8PGFuc1sxXTsKCXJldHVybiAwOwp9