Problem: You are given a circular array with n elements. The elements are numbered from some element with values from 1 to n in clockwise order. The i-th cell contains the value ai. The robot Simba is in cell s.

Each moment of time the robot is in some of the n cells (at the begin he is in s). In one turn the robot can write out the number written in current cell or move to the adjacent cell in clockwise or counterclockwise direction. To write out the number from the cell Simba doesn't spend any time, but to move to adjacent cell Simba spends one unit of time.

Simba wants to write the number from each cell one time, so the numbers will be written in a non decreasing order. Find the least number of time units to write out all numbers.

Input

The first line contains two integers n and s (1 ≤ s ≤ n ≤ 2000) — the number of cells in the circular array and the starting position of Simba.

The second line contains n integers ai ( - 109 ≤ ai ≤ 109) — the number written in the i-th cell. The numbers are given for cells in order from 1 to n. Some of numbers ai can be equal.

Output

In the first line print the number t — the least number of time units.

Each of the next n lines should contain the direction of robot movement and the number of cells to move in that direction. After that movement the robot writes out the number from the cell in which it turns out. The direction and the number of cells should be printed in the form of +x in case of clockwise movement and -x in case of counterclockwise movement to x cells (0 ≤ x ≤ n - 1).

Note that the sum of absolute values of x should be equal to t.

Examples

Input

9 1
0 1 2 2 2 1 0 1 1


Output

12
+0
-3
-1
+2
+1
+2
+1
+1
+1


Input

8 1
0 1 0 1 0 1 0 1


Output

13
+0
+2
+2
+2
-1
+2
+2
+2


Input

8 1
1 2 3 4 5 6 7 8


Output

7
+0
+1
+1
+1
+1
+1
+1
+1


Input

8 1
0 0 0 0 0 0 0 0


Output

7
+0
+1
+1
+1
+1
+1
+1
+1

Solution (in PYTHON):

Solution:
from collections import defaultdict

# end2 = start - end
def construct_clockwise_path(end2, numbers2, circumference):
    path = []
    pos, i = 0, 0
    while end2 > numbers2[i]:
        path.append(numbers2[i] - pos)
        pos = numbers2[i]
        i += 1
    path.append(-(pos + circumference - numbers2[-1]))
    pos, i = numbers2[-1], -1
    while end2 < numbers2[i]:
        path.append(numbers2[i-1] - numbers2[i])
        i -= 1
    return path

def construct_path(end2, direction, numbers2, circumference):
    if direction == -1:
        numbers2 = list(reversed([circumference - i for i in numbers2]))
        end2 = circumference - end2
    result = construct_clockwise_path(end2, numbers2, circumference)
    if direction == -1:
        return [-i for i in result]
    return result

def time_to_collect(start, numbers, circumference):
    result = {} # end2: (time, direction)
    n = len(numbers)

    numbers2 = []
    _numbers2 = []
    i = 0
    while i < n and numbers[i] < start:
        _numbers2.append(circumference - start + numbers[i])
        i += 1
    while i < n:
        numbers2.append(numbers[i] - start)
        i += 1
    i = 0
    numbers2.extend(_numbers2)

    for i in range(n):
        pos = numbers2[i]
        lpos = numbers2[i-1] if i > 0 else 0
        rpos = numbers2[i+1] if i < n - 1 else circumference
        result[pos] = min(
                (2 * lpos + circumference - pos, 1),
                (2 * (circumference - rpos) + pos, -1))
    return result, numbers2

def add_number(times_to_starts, positions, circumference):
    result = {}
    for s in times_to_starts:
        res, num2 = time_to_collect(s, positions, circumference)
        for k in res:
            time, direction = res[k]
            time += times_to_starts[s][0]
            pos = (s + k) % circumference
            if pos not in result or result[pos][0] > time:
                result[pos] = (time, direction, k, num2) # k == end2
    return result

def solve(n, pos, circle):
    number_positions = defaultdict(list)
    pos -= 1

    for i in range(n):
        number_positions[circle[i]].append(i)
    numbers = sorted(number_positions.keys())

    t2s = {pos: (0, None, None, None)}
    floors = {}

    for num in numbers:
        t2s = add_number(t2s, sorted(number_positions[num]), n)
        floors[num] = t2s

    result = []

    end, _ = min(floors[numbers[-1]].items(), key = lambda x: x[1][0])

    for num in reversed(numbers):
        time, direction, end2, num2 = floors[num][end]
        _result = result
        result = construct_path(end2, direction, num2, n)
        result.extend(_result)
        end = (end - end2) % n

    print(sum(abs(i) for i in result))
    for i in result:
        if i >= 0:
            print('+%s' % i)
        else:
            print(i)

n, pos = tuple(int(x) for x in raw_input().split(' '))
circle = tuple(int(x) for x in raw_input().split())
solve(n, pos, circle)

#import random
#N=2000
#solve(N, 42, [random.randint(0, 1) for i in range(N)])