import java.util.Arrays ;
public class FoxesOfTheRoundTable {
public int [ ] minimalDifference( int [ ] h) {
for ( int i = 0 ; i < h.length ; i++ )
h[ i] = h[ i] * 100 + i;
int [ ] ret = new int [ h.length ] ;
int p = 0 ;
for ( int i = 0 ; i < h.length ; i++ )
if ( i % 2 == 0 )
ret[ p++ ] = h[ i] % 100 ;
for ( int i = h.length - 1 ; i >= 0 ; i-- )
if ( i % 2 == 1 )
ret[ p++ ] = h[ i] % 100 ;
return ret;
}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheXM7CgpwdWJsaWMgY2xhc3MgRm94ZXNPZlRoZVJvdW5kVGFibGUgewogICAgcHVibGljIGludFtdIG1pbmltYWxEaWZmZXJlbmNlKGludFtdIGgpIHsKCSAgIGZvcihpbnQgaSA9IDA7IGkgPCBoLmxlbmd0aDsgaSsrKQogICAgICAgICAgICBoW2ldID0gaFtpXSAqIDEwMCArIGk7CiAgICAgICAgQXJyYXlzLnNvcnQoaCk7CiAgICAgICAgaW50W10gcmV0ID0gbmV3IGludFtoLmxlbmd0aF07CiAgICAgICAgaW50IHAgPSAwOwogICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBoLmxlbmd0aDsgaSsrKQogICAgICAgICAgICBpZihpICUgMiA9PSAwKQogICAgICAgICAgICAgICAgcmV0W3ArK10gPSBoW2ldICUgMTAwOwogICAgICAgIGZvcihpbnQgaSA9IGgubGVuZ3RoLTE7IGkgPj0gMDsgaS0tKQogICAgICAgICAgICBpZihpICUgMiA9PSAxKQogICAgICAgICAgICAgICAgcmV0W3ArK10gPSBoW2ldICUgMTAwOwogICAgICAgIHJldHVybiByZXQ7CiAgICB9Cn0K