#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
int main(int argc, char *argv[])
{
std::vector<int> v { 0, 1, 2, 3, 4 };
auto i = find(begin(v), end(v), 2);
std::cout << *i << std::endl;
std::reverse_iterator<decltype(i)> ri(i);
std::cout << *ri << std::endl;
}
ICAgICNpbmNsdWRlIDxpb3N0cmVhbT4KICAgICNpbmNsdWRlIDx2ZWN0b3I+CiAgICAjaW5jbHVkZSA8aXRlcmF0b3I+CiAgICAjaW5jbHVkZSA8YWxnb3JpdGhtPgoKICAgIGludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCiAgICB7CiAgICAgICAgc3RkOjp2ZWN0b3I8aW50PiB2IHsgMCwgMSwgMiwgMywgNCB9OwogICAgICAgIGF1dG8gaSA9IGZpbmQoYmVnaW4odiksIGVuZCh2KSwgMik7CgogICAgICAgIHN0ZDo6Y291dCA8PCAqaSA8PCBzdGQ6OmVuZGw7CgogICAgICAgIHN0ZDo6cmV2ZXJzZV9pdGVyYXRvcjxkZWNsdHlwZShpKT4gcmkoaSk7CiAgICAgICAgc3RkOjpjb3V0IDw8ICpyaSA8PCBzdGQ6OmVuZGw7CiAgICB9Cg==