// Arup Guha
// 8/30/2016
// Program to aid decryption for CIS 3362 Week One Assignment
// Counts letter frequencies, and also prints out encryption
// of the input text using the fixed keys a = 7, b = 12 for question 4.

#include <stdio.h>
#include <string.h>

int main() {

    char cipher[1000];
    scanf("%s", cipher);

    int freq[26];
    int i;

    for (i=0; i<26; i++) freq[i] = 0;

    for (i=0; i<strlen(cipher); i++) {
        freq[cipher[i]-'a']++;
        printf("%c", (7*(cipher[i]-'a')+12)%26 + 'a');
    }
    printf("\n");

    for (i=0; i<26; i++)
        printf("%c %d\n", 'a'+i, freq[i]);

    return 0;
}
