#C8299. First Non-Repeating Character

    ID: 52265 Type: Default 1000ms 256MiB

First Non-Repeating Character

First Non-Repeating Character

You are given a string \( S \). Your task is to find the first character in \( S \) that does not repeat. If every character in \( S \) repeats at least once, print the character $.

Example:

Input: swiss
Output: w

Input: aabbcc Output: $

</p>

Use an efficient approach considering that the string can be very large.

inputFormat

The input consists of a single line containing the string \( S \). It is read from standard input (stdin).

outputFormat

Output a single character: the first non-repeating character in \( S \), or $ if no such character exists. The output should be printed to standard output (stdout).

## sample
swiss
w