This page is still under construction.

Parts of this page are still being built. What you see may change.

Counting Swann's Coins

Interview

Time limit1sMemory limit128 MB

Summary
Print numbers 1 through N, replacing multiples of 3 with Dead, of 5 with Man, and of 15 with DeadMan, breaking the line after each word.
Level

Easy2 of 10

Topics
Implementation, Math, Simulation
Solved
No attempts yet

Problem

Governor Weatherby Swann orders you to count the coins in the government treasury. To make the task less dull, you count out loud from 11 up to the given number, replacing some numbers with words according to these rules:

  • Say Dead for every multiple of 33.
  • Say Man for every multiple of 55.
  • Say DeadMan for every number that is a multiple of both 33 and 55 (that is, every multiple of 1515).

Every other number is said as its ordinary value.

Input

A single line containing one integer NN, the number of coins to count (N≥0N \geq 0).

Output

Print the counting sequence for 1,2,…,N1, 2, \dots, N. Ordinary numbers are separated by single spaces. A word (Dead, Man, or DeadMan) is always the last token on its line, so after saying a word you move to a new line. Every printed line ends with a newline character, including the final line even when it ends with an ordinary number because NN is not a multiple of 33 or 55.

Examples5

  1. Example 1

    Input
    4
    
    Expected output
    1 2 Dead
    4
    
  2. Example 2

    Input
    18
    
    Expected output
    1 2 Dead
    4 Man
    Dead
    7 8 Dead
    Man
    11 Dead
    13 14 DeadMan
    16 17 Dead
    
  3. Example 3

    Input
    1
    
    Expected output
    1
    
  4. Example 4

    Input
    3
    
    Expected output
    1 2 Dead
    
  5. Example 5

    Input
    5
    
    Expected output
    1 2 Dead
    4 Man