#include <iostream>
#include <string>
#define _USE_MATH_DEFINES
#include <math.h>
void f(std::string str){
int i;
int l=str.length();
int r=l/M_PI/2.0*2.3;
int w=r*2+2;
std::string buf;
buf.assign(w*w*2,(" ")[0]);
for(i=0;i<l;i++){
float x=r+r*cos(i*M_PI*2.0/l-M_PI/2);
float y=r+r*sin(i*M_PI*2.0/l-M_PI/2);
buf[(int)(((w+w*((int)y))+(1+x))*2)]=str[i];
}
for(i=0;i<w;i++){
std::cout<<buf.substr(w*i*2,w*2)<<std::endl;
}
}
int main(){
f(std::string("c123456789ab"));
f(std::string("0123456789qawsedrftgyhujikolp"));
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKI2luY2x1ZGUgPHN0cmluZz4KCiNkZWZpbmUgX1VTRV9NQVRIX0RFRklORVMKCiNpbmNsdWRlIDxtYXRoLmg+Cgp2b2lkIGYoc3RkOjpzdHJpbmcgc3RyKXsKCglpbnQgaTsKCglpbnQgbD1zdHIubGVuZ3RoKCk7CgoJaW50IHI9bC9NX1BJLzIuMCoyLjM7CgoJaW50IHc9cioyKzI7CgoJc3RkOjpzdHJpbmcgYnVmOwoKCWJ1Zi5hc3NpZ24odyp3KjIsKCIgIilbMF0pOwoKCWZvcihpPTA7aTxsO2krKyl7CgoJCWZsb2F0IHg9cityKmNvcyhpKk1fUEkqMi4wL2wtTV9QSS8yKTsKCgkJZmxvYXQgeT1yK3Iqc2luKGkqTV9QSSoyLjAvbC1NX1BJLzIpOwoKCQlidWZbKGludCkoKCh3K3cqKChpbnQpeSkpKygxK3gpKSoyKV09c3RyW2ldOwoKCX0KCglmb3IoaT0wO2k8dztpKyspewoKCQlzdGQ6OmNvdXQ8PGJ1Zi5zdWJzdHIodyppKjIsdyoyKTw8c3RkOjplbmRsOwoKCX0KCn0KCmludCBtYWluKCl7CgoJZihzdGQ6OnN0cmluZygiYzEyMzQ1Njc4OWFiIikpOwoKCWYoc3RkOjpzdHJpbmcoIjAxMjM0NTY3ODlxYXdzZWRyZnRneWh1amlrb2xwIikpOwoKCXJldHVybiAwOwoKfQ==