This page is still under construction.

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

Fraction

Interview

Time limit2sMemory limit1024 MB

Summary
Given n, find the largest proper fraction whose numerator and denominator are coprime and sum to n.
Level

Medium5 of 10

Topics
Number theory, Math, Implementation, Brute force
Solved
No attempts yet

Problem

Kolya is in third grade, and they are studying simple fractions with natural numerators and denominators. Yesterday in class Kolya learned that a fraction is called proper if its numerator is less than its denominator, and irreducible if there is no fraction equal to it with a smaller natural numerator and denominator.

Kolya loves mathematics, so at home he experimented for a long time, inventing and solving various problems with proper irreducible fractions. He suggests that you solve one of these problems with a computer.

Find the largest proper irreducible fraction whose numerator and denominator sum to nn.

Input

The input file contains a single integer nn (3≤n≤10003\le n\le 1000).

Output

Print the numerator and denominator of the required fraction to the output file.

Examples2

  1. Example 1

    Input
    10
    
    Expected output
    3 7
    
  2. Example 2

    Input
    23
    
    Expected output
    11 12