//wa 一次 没考虑 1 1 1 1 1 的情况
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int cmp_int(const void *a,const void *b)
{
return *(int *)b - *(int *)a;
}
int Find(int f,int num[],int n)
{
int i;
for(i = n-1;i >=0;i--)
if(f == num[i]) return i+1;
}
void Flip(int num[],int n)
{
int i,j,cnum[200];
for(i = 0;i < n;i++) cnum[i] = num[i];
qsort(cnum,n,sizeof(int),cmp_int);
for(i = 0;i < n;i++){
int location;
location = Find(cnum[i],num,n);
if((location == n - i) || (cnum[i] == num[n-i-1])) continue;
else if(location != 1){
printf("%d ",n - location + 1);
int j;
for(j = 0;j < location /2;j++ ){
int temp;
temp = num[j];
num[j] = num[location - j - 1];
num[location - j - 1] = temp;
}
printf("%d ",i + 1);
for(j = 0;j < (n-i)/2;j++ ){
int temp;
temp = num[j];
num[j] = num[n-i-j-1];
num[n-i-j-1] = temp;
}
}
else{
printf("%d ",i + 1);
for(j = 0;j < (n-i)/2;j++ ){
int temp;
temp = num[j];
num[j] = num[n-i-j-1];
num[n-i-j-1] = temp;
}
}
}
}
int to_num(char *s,int num[]) //在网上学的别人的代码
{
int n = 0,begin = 0,end = 0,len = strlen(s);
while(end < len){
int t = 0;
while(s[end]!=' '&& s[end] != 0) end++;
while(begin < end){
t*=10;
t+=s[begin] - '0';
begin++;
}
num[n++] = t;
begin = end + 1;end = begin;
}
return n;
}
int main()
{
int i,num[200];
char a[200];
while(gets(a)!=NULL){
int n;
printf("%s/n",a);
n = to_num(a,num);
Flip(num,n);
printf("0/n");
}
return 0;
}