#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int array[] = { 0, 1 , 2 , 3 ,4 ,5 ,6};
for (int i = 0; i<7; ++i) {cout << array[i] << " ";}
cout <<'\n';
std::rotate(array, array+1, array+7);
for (int i = 0; i<7; ++i) {cout << array[i] << " ";}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJCglpbnQgYXJyYXlbXSA9IHsgMCwgMSAsIDIgLCAzICw0ICw1ICw2fTsKCQoJZm9yIChpbnQgaSA9IDA7IGk8NzsgKytpKSB7Y291dCA8PCBhcnJheVtpXSA8PCAiICI7fQoJY291dCA8PCdcbic7CgkKICAgICAgICAgICAgc3RkOjpyb3RhdGUoYXJyYXksIGFycmF5KzEsIGFycmF5KzcpOwoJZm9yIChpbnQgaSA9IDA7IGk8NzsgKytpKSB7Y291dCA8PCBhcnJheVtpXSA8PCAiICI7fQoJCglyZXR1cm4gMDsKfQ==