1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 int main() 5 { 6 string s; 7 cin >> s; 8 int N = s.size(); 9 int n1=(N+2)/3, n3 = (N+2)/3; 10 int n2 = N + 2 - n1 - n3; 11 for(int i = 0; i<n1; ++i) 12 { 13 if(i == n1-1) 14 for(int j = i; j<n1+n2-1; ++j) 15 printf("%c",s[j]); 16 else 17 { 18 printf("%c",s[i]); 19 for(int j = 0; j<n2-2; ++j) 20 printf(" "); 21 printf("%c",s[N-i-1]); 22 } 23 printf(" "); 24 } 25 return 0; 26 }