Problem

5 /13


Rearrangement of words

Theory Click to read/hide

When entering a string, you can immediately divide it into parts by any separator.
We've done this before when we entered multiple numeric variables on the same line. We used the Split() method to split a string into parts. By default, it separates strings into substrings by space.
Using this method, you can split the string into parts, for example, by spaces. And write each part of the string into a separate variable.
Example:

string[] S = Console.ReadLine().Split();
In the example, when entering two words separated by a space, the first word is stored in the zero element of the s[0] array, the second - in the second s[1].

If you need to use several characters as separators, you can specify them separated by commas:
 
 string[] S = Console.ReadLine().Split(new[] { ' ', '\n' });
 If there can be several consecutive spaces in the input string, then spaces can also appear in the final array, to exclude this, you need to add a parameter:
string[] S = Console.ReadLine().Split(new[] { ' ', '\n' }, StringSplitOptions.RemoveEmptyEntries);
If you need to use substring delimiters:
string[] S = Console.ReadLine().Split(new[] { "\\r\\n", "\r", "\n", "" }, StringSplitOptions.RemoveEmptyEntries);

Problem

The input is one line containing the last name and first name of the person (separated by exactly one space).
 
Print the same information, but first name and then last name.
 
Example
# Input Output
1 Pupkin Vasya Vasya Pupkin