比赛的时候题目意思理解错了,大水题,1A
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<=(b);++i)
#define REPD(i,a,b) for(int i=a;i>=(b);--i)
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
int main(int argc, char const *argv[])
{char s[30]; char ans[30];scanf("%s",s);int p1,p2;REP(i,0,26) {bool ok=false;REP(j,i+1,26) if(s[i]==s[j]) {p1=i;p2=j;ok=true;break;}if(ok) break;}if(p2-p1==1) {printf("Impossible\n");return 0;}int n=p2-p1-1;int n1=n/2;REP(i,12-n1,12) {if(p1==p2) p1++; ans[i]=s[(p1++)%27];}REPD(i,25,13) {if(p1==p2) p1++; ans[i]=s[(p1++)%27];}REP(i,0,12-n1-1){if(p1==p2) p1++; ans[i]=s[(p1++)%27];}REP(i,0,25) {printf("%c", ans[i]);if(i==12) printf("\n");}return 0;
}