#include <vector>
#include <iostream>
using namespace std;
int main() {
size_t imax = -1;
vector< int > vec;
int val = 0;
while( cin >> val )
{
if( val )
{
vec.push_back(val);
if( imax == -1 )
imax = 0;
else
if( val > vec[imax] )
imax= vec.size() - 1;
}
}
if( imax != -1 )
{
cout<<"MAX_INDEX: "<<imax<<endl;
cout<<"MAX VALUE: "<<vec[imax]<<endl;
}
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewoJc2l6ZV90IGltYXggPSAtMTsKCXZlY3RvcjwgaW50ID4gdmVjOwoJaW50IHZhbCA9IDA7Cgl3aGlsZSggY2luID4+IHZhbCApCgl7CgkJaWYoIHZhbCApCgkJewoJCQl2ZWMucHVzaF9iYWNrKHZhbCk7CgkJCWlmKCBpbWF4ID09IC0xICkKCQkJICAgIGltYXggID0gIDA7CgkJCWVsc2UKCQkJaWYoIHZhbCA+IHZlY1tpbWF4XSApCgkJCQlpbWF4PSB2ZWMuc2l6ZSgpIC0gMTsKCQl9Cgl9CglpZiggaW1heCAhPSAtMSApCgl7CgkJY291dDw8Ik1BWF9JTkRFWDogIjw8aW1heDw8ZW5kbDsKCQljb3V0PDwiTUFYIFZBTFVFOiAiPDx2ZWNbaW1heF08PGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==