Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/funksiya-oxirgi-raqam

Last digit

Easy 1000 ms 128 MB 21%
Share

Write a function LastDigit(x) that returns the last digit of the integer $x$.

Example 1: LastDigit(1234) → 4

Example 2: LastDigit(-47) → 7 — for a negative number the last digit is returned too.

Write only the function body.

A number goes into the function LastDigit, which returns its last digit

Input

One line with an integer $x$ — the argument of the function.

Output

The value returned by the function: a digit from $0$ to $9$.

Note

$-10^{9} \le x \le 10^{9}$

Examples

Input #1
1234
Output #1
4
Input #2
-47
Output #2
7

Sign in to submit a solution

Signing up is free and takes a minute.