#include <iostream.h>
#include <string>

int main() {
	string encryptedMessage;
	int columns, rows;
	
	cin >> encryptedMessage;
	columns = (encryptedMessage[0]-'A'+1)%3+3;
	rows = encryptedMessage.length()/columns+1;
	for(int i=0; i<rows; i++) {
		for(int j=0; j<columns; j++) {
			if(i+j*rows < encryptedMessage.length()) {
				if(encryptedMessage[i + j*rows] == '*') {
					cout << ' ';
				}
				else {
					cout << encryptedMessage[i + j*rows];
				}
			}
		}
	}
	cout << endl;
}
