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

#define MAX_STRING_SIZE 100

int main() {
  char input[MAX_STRING_SIZE] = {};
  char filtered[MAX_STRING_SIZE] = {};
  int last_real_char = 0;
  printf("Enter message: ");
  fgets(input, MAX_STRING_SIZE, stdin);
  for (int i = 0; i < MAX_STRING_SIZE - 1; i++) {
    char current_char = toupper(input[i]);
    if (current_char != 0) {
      last_real_char = i;
    }
    switch (current_char) {
    case 'A':
      filtered[i] = '4';
      break;
    case 'B':
      filtered[i] = '8';
      break;
    case 'E':
      filtered[i] = '3';
      break;
    case 'I':
      filtered[i] = '1';
      break;
    case 'O':
      filtered[i] = '0';
      break;
    case 'S':
      filtered[i] = '5';
      break;
    default:
      filtered[i] = current_char;
      break;
    }
  }
  for (int i = last_real_char; i < last_real_char + 10; i++) {
    filtered[i] = '!';
  }
  printf("Entered message: %s", filtered);
}
