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

int main() {
  char s[161], m1[161], m2[161];
  int c1 = 0, c2 = 0;

  fgets(s, sizeof(s), stdin);

  for (int i = 0; i < strlen(s); i++) {
    if (isalpha(s[i])) {
      if (isupper(s[i])) {
        m1[c1++] = s[i];
      } else m2[c2++] = s[i];
    }

  }
  printf("Nachricht an Toni: %s\n", m1);
  printf("Nachricht an Tomke: %s\n", m2);

}
