#MTHA0000015. Phân phối theo vòng (Circular Distribution)

Phân phối theo vòng (Circular Distribution)

Circular Distribution

Version: Phuoc Hung OJ Extended

Problem Statement

There are MM boxes arranged in a circle and numbered from 11 to MM. The first item is placed in box SS; each next item goes to the next box, wrapping after box MM. Given NN items, determine the box receiving the NN-th item and the number of complete rounds finished before placing it. A complete round consists of MM consecutive items, one per box.

Input

One line contains three positive integers MM, SS, and NN.

Output

Print two integers: the box receiving the NN-th item and the number of complete rounds finished before placing it.

Subtasks

  • Subtask 1 (30 points):
    • 1≤S≤M≤1061 \le S \le M \le 10^6.
    • 1≤N≤1061 \le N \le 10^6.
  • Subtask 2 (70 points):
    • 1≤S≤M≤10181 \le S \le M \le 10^{18}.
    • 1≤N≤10181 \le N \le 10^{18}.

Examples

Example 1

Input

5 3 1

Output

3 0

Explanation

The first item goes directly to box 33. No item has been placed before it, so zero complete rounds have finished.

Example 2

Input

5 3 8

Output

5 1

Explanation

The first eight destinations are 3,4,5,1,2,3,4,53,4,5,1,2,3,4,5. Before item 88, seven items have been placed, giving 7÷5=17\div5=1 complete round.

Example 3

Input

10 10 21

Output

10 2

Explanation

Before item 2121, twenty items have been placed, giving 20÷10=220\div10=2 complete rounds. After twenty shifts, the position returns to box 1010.