This page is still under construction.

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

Divisors and Multiples

Interview

Time limit1sMemory limit128 MB

Summary
For each pair of numbers, print factor if the first divides the second, multiple if the first is a multiple of the second, or neither.
Level

Easy1 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

We have 4×3=124 \times 3 = 12.

From this equation we can observe the following facts.

  • 33 is a divisor of 1212, and 1212 is a multiple of 33.
  • 44 is a divisor of 1212, and 1212 is a multiple of 44.

Given two numbers, write a program that determines which of the following three relationships holds between the first number and the second number.

  1. The first number is a divisor of the second number.
  2. The first number is a multiple of the second number.
  3. The first number is neither a divisor nor a multiple of the second number.

Input

The input consists of several test cases. Each test case is given on one line as two natural numbers, each not exceeding 10,00010{,}000. The two numbers are never equal. The last line of the input contains two zeros, and this line is not processed.

Output

For each test case, print factor if the first number is a divisor of the second number, multiple if the first number is a multiple of the second number, or neither if it is neither, each on its own line.

Examples1

  1. Example 1

    Input
    8 16
    32 4
    17 5
    0 0
    
    Expected output
    factor
    multiple
    neither