#include <stdio.h>
#include <string.h>

void printPigLatin(char *word) {
    printf("%s%cay ", word + 1, word[0]);
}

int main(void) {
    char phrase[100];
    printf("Enter a phrase: ");
    fgets(phrase, sizeof(phrase), stdin);
    phrase[strcspn(phrase, "\n")] = '\0'; // إزالة سطر الإدخال

    char *token = strtok(phrase, " ");
    while (token != NULL) {
        printPigLatin(token);
        token = strtok(NULL, " ");
    }
    printf("\n");
    return 0;
}