#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int K;
  int Fruit[1000];
  int sum = 0;
  cin >> N;
  cin >> K;
  for (int i = 0; i < N; i++) {
    cin >> Fruit[i];
  }
  for (int i = 0; i < K; i++) {
    if (Fruit[i] <= Fruit[i + 1])
      sum += Fruit[i];
    else
      sum += Fruit[i + 1];
  }
  cout << "\n This shope sells Fruit";
  for (int i = 1; i <= N; i++) cout << i << " ";
  cout << "For ";
  for (int i = 0; i < N; i++) cout << Fruit[i] << "yen, ";
  cout << "respectively.";
  cout << "\n The minimum total price is " << sum;
  return 0;
}
