#K94307. Swap First and Last Character
Swap First and Last Character
Swap First and Last Character
You are given a string s as input. Your task is to swap the first and the last characters of this string. If the string has a length of 1 or is empty, simply output the string as is.
For example, if s is hello
, swapping the first and last characters would result in oellh
.
Note: Use efficient input/output methods since all data is read from stdin
and written to stdout
.
inputFormat
The input consists of a single line containing the string s. The string may be empty or contain one or more characters.
outputFormat
Output a single line containing the resultant string after swapping its first and last characters.
## samplehello
oellh