This page is still under construction.

Parts of this page are still being built. What you see may change.

Average Character

Interview

Time limit1sMemory limit1024 MB

Summary
Given a printable ASCII string, output the character whose ASCII value is the floor of the average of all characters' ASCII values.
Level

Easy2 of 10

Topics
String, Math, Implementation
Solved
No attempts yet

Problem

Have you ever wondered what the average ASCII character of any given string is? No? Never? Really? Well, is it a character in the string or something else?

Would you do this calculation by hand with an ASCII table? Probably not! All modern programming languages include functions for converting an ASCII character to an integer, and to convert an integer to an ASCII character. Of course, these functions often also handle unicode characters as well, but that is not part of this problem.

Given a string of ASCII characters, compute the average character. If the average character lies between two integer ASCII values, return the smaller one.

Input

The single line of input contains a single string ss (1≤∣s∣≤1001 \le |s| \le 100), which consists of ASCII text. All of the characters of ss will be printable ASCII, between ASCII 3232 (space:' ') and ASCII 126126 (tilde:'~'). It will NOT contain any control characters such as carriage returns, line feeds, tabs, etc. It is NOT guaranteed to begin, end, or even contain a non-space character.

Output

Output a single ASCII character, which is the average of all of the ASCII characters in ss.

Examples3

  1. Example 1

    Input
    ABCDE
    
    Expected output
    C
    
  2. Example 2

    Input
    AbCdE
    
    Expected output
    O
    
  3. Example 3

    Input
    aBcDe
    
    Expected output
    V