Jerry and Tom

Interview

Time limit1sMemory limit128 MB

Summary
Subtract the fraction A/B from 1 and print the remaining cheese as P/Q in lowest terms.
Level

Easy1 of 10

Topics
Math, Number theory, Implementation
Solved
No attempts yet

Problem

Tom bought 1 kg of cheese at the store and came back home.

While Tom was looking away, Jerry came and stole A/B kg of it.

How much cheese does Tom have left after Jerry stole some?

Input

The first line gives two integers A and B (1 ≤ A < B ≤ 9).

A and B are guaranteed to be coprime.

Output

If the answer, written as a fraction in lowest terms, is P/Q kg, print P and Q on the first line separated by a space.

Examples2

  1. Example 1

    Input
    2 7
    
    Expected output
    5 7
    
  2. Example 2

    Input
    5 8
    
    Expected output
    3 8