I need to read a string in a following order:

1. Read any amount of numbers separated by spaces, discard all but the last one, saving it to `n`
2. Read a space followed by `n` characters followed by space, save only the characters
3. Read two more numbers separated by spaces and save them as well

I thought of using string stream to read the numbers and stop at the string, but I don't know how to predict a string in string stream and stop reading numbers without "reading" the string as number and killing the string stream.  

How predict a string and stop reading numbers before it?  

Is there a better way to read this whole pattern?  

I use C++11.

Edit:  

Example input: 

```
1 2 3 4 6 abc de 7 8

```

Excepted output:

```
The string: 'abc de'
Number 1: 7
Number 2: 8

```