Under construction

Still being built. Things may change

Divisions

Time limit1sMemory limit1024 MB

Summary
Given a rating and the divisions a contest runs in, print each division the participant can enter, with an asterisk on out-of-competition entries.
Level

Easy2 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Misha plans to build a new website for computer science olympiads. The contests will run in three divisions. The lower the division number, the harder the problems in it.

Each participant has an integer rating from 00 to 50005000. Each participant has a base division determined by their rating.

  • Participants with a rating from 00 to 16001600 have division 3 as their base division.
  • Participants with a rating from 16011601 to 19001900 have division 2 as their base division.
  • Participants with a rating above 19001900 have division 1 as their base division.

Each contest can run in one or more divisions. Each participant takes part in exactly one division.

  • If the contest is held in the participant's base division, the participant takes part in that division.
  • Otherwise, the participant may choose any of the available divisions to take part in.
  • If the participant's rating is higher than the rating of every participant whose base division is the division they take part in, the participant takes part out of competition.

Given a participant's rating and the list of divisions where the contest is held, determine in which divisions the participant can take part and with what status.

Input

The first line contains an integer rr, the rating of the participant (0≤r≤50000 \le r \le 5000).

The second line contains one to three distinct characters. Each character is 1, 2, or 3. These characters show the divisions where the contest is held. The divisions are listed in increasing order without spaces.

Output

Print one or more lines. For each division in which the participant can take part, print the division number. If the participant can take part in that division only out of competition, print an asterisk (*) right after the number. Print the divisions in increasing order of number.

Note

In the first example, a participant whose base division is 1 must take part in their own division.

In the second example, a participant whose base division is 2 can take part in both division 1 and division 3, but taking part in division 3 is out of competition.

Examples2

  1. Example 1

    Input
    2200
    12
    
    Expected output
    1
    
  2. Example 2

    Input
    1750
    13
    
    Expected output
    1
    3*