#include "stdio.h"
main()
{int i=0,j,m,k;
char a[50][80],b[80],*p=b;
FILE *fp;
fp=fopen("e:\in.txt","r");
while (fgets(a[i],80,fp)!=NULL)
i++;
fclose(fp);
m=i;
clrscr();
scanf("%d",&k);
for (i=0;i<m;i++)
if (i+1==k)
{strcpy(p,a[i]);
m=m-1;
for (j=i;j<=m-1;j++)
strcpy(a[j],a[j+1]);
}
i=0;
fp=fopen("e:\out.txt","r");
while (fgets(a[i],80,fp)!=NULL)
i++;
m=i;
for (i=0;i<m;i++)
printf("%s",a[i]);
scanf("%d",&k);
for (i=0;i<m;i++)
if (i+1==k)
{m=m+1;
for (j=m;j>=i;j--)
strcpy(a[j],a[j-1]);
strcpy(a[j],p);
}
fclose(fp);
fp=fopen("e:\out.txt","w");
for (i=0;i<m;i++)
{fputs(a[i],fp);
puts(a[i]);
}
fclose(fp);
}