output_description: Print the maximum possible value of (the absolute value of the total beauty) +
  (the absolute value of the total tastiness) + (the absolute value of the total
  popularity) for the set of cakes that Ringo chooses.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      x_1 y_1 z_1
      x_2 y_2 z_2
       :  :
      x_N y_N z_N
attempt: n, m = map(int, input().split())
  l = []
  li = []
  lis = []
  
  for i in range(n):
      a, b, c = map(int, input().split())
      l.append(a)
      li.append(b)
      lis.append(c)
  ans = []
  
  l11 = list(l)
  l1 = sorted(list(l))
  li1 = list(li)
  lis1 = list(lis)
  cou1 = 0
  l22 = list(l)
  l2 = sorted(list(l), reverse=True)
  li2 = list(li)
  lis2 = list(lis)
  cou2 = 0
  l3 = list(l)
  li33 = list(li)
  li3 = sorted(list(li))
  lis3 = list(lis)
  cou3 = 0
  l4 = list(l)
  li44 = list(li)
  li4 = sorted(list(li), reverse=True)
  lis4 = list(lis)
  cou4 = 0
  l5 = list(l)
  li5 = list(li)
  lis55 = list(lis)
  lis5 = sorted(list(lis))
  cou5 = 0
  l6 = list(l)
  li6 = list(li)
  lis66 = list(lis)
  lis6 = sorted(list(lis), reverse=True)
  cou6 = 0
  
  cou1 += abs(sum(l1[0:m]))
  lili1 = []
  lislis1 = []
  for i in range(m):
      lili1.append(li[l11.index(l1[i])])
      lislis1.append(lis[l11.index(l1[i])])
      l11[l11.index(l1[i])] = "inf"
  cou1 += abs(sum(lili1)) + abs(sum(lislis1))
  ans.append(cou1)
  
  
  cou2 += abs(sum(l2[0:m]))
  lili2 = []
  lislis2 = []
  for i in range(m):
      lili2.append(li[l22.index(l2[i])])
      lislis2.append(lis[l22.index(l2[i])])
      l22[l22.index(l2[i])] = "inf"
  cou2 += abs(sum(lili2)) + abs(sum(lislis2))
  ans.append(cou2)
  
  
  cou3 += abs(sum(li3[0:m]))
  ll3 = []
  lislis3 = []
  for i in range(m):
      ll3.append(l[li33.index(li3[i])])
      lislis3.append(lis[li33.index(li3[i])])
      li33[li33.index(li3[i])] = "inf"
  cou3 += abs(sum(ll3)) + abs(sum(lislis3))
  ans.append(cou3)
  
  
  cou4 += abs(sum(li4[0:m]))
  ll4 = []
  lislis4 = []
  for i in range(m):
      ll4.append(l[li44.index(li4[i])])
      lislis4.append(lis[li44.index(li4[i])])
      li44[li44.index(li4[i])] = "inf"
  cou4 += abs(sum(ll4)) + abs(sum(lislis4))
  ans.append(cou4)
  
  
  cou5 += abs(sum(lis5[0:m]))
  ll5 = []
  lili5 = []
  for i in range(m):
      ll5.append(l[lis55.index(lis5[i])])
      lili5.append(li[lis55.index(lis5[i])])
      lis55[lis55.index(lis5[i])] = "inf"
  cou5 += abs(sum(ll5)) + abs(sum(lili5))
  ans.append(cou5)
  
  
  cou6 += abs(sum(lis6[0:m]))
  ll6 = []
  lili6 = []
  for i in range(m):
      ll6.append(l[lis66.index(lis6[i])])
      lili6.append(li[lis66.index(lis6[i])])
      lis66[lis66.index(lis6[i])] = "inf"
  cou6 += abs(sum(ll6)) + abs(sum(lili6))
  ans.append(cou6)
  
  print(max(ans))
  
problem_description: Statement
  
  Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to
  celebrate AtCoder Beginner Contest 100.
  
  The shop sells N kinds of cakes.  
  Each kind of cake has three parameters "beauty", "tastiness" and "popularity".
  The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the
  popularity of z_i.  
  These values may be zero or negative.
  
  Ringo has decided to have M pieces of cakes here. He will choose the set of
  cakes as follows:
  
    * Do not have two or more pieces of the same kind of cake.
    * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity).
  
  Find the maximum possible value of (the absolute value of the total beauty) +
  (the absolute value of the total tastiness) + (the absolute value of the total
  popularity) for the set of cakes that Ringo chooses.
samples: [{"input": "5 3\n    3 1 4\n    1 5 9\n    2 6 5\n    3 5 8\n    9 7 9", "output": "56\n    \n\nConsider having the 2-nd, 4-th and 5-th kinds of cakes. The total beauty,\ntastiness and popularity will be as follows:\n\n  * Beauty: 1 + 3 + 9 = 13\n  * Tastiness: 5 + 5 + 7 = 17\n  * Popularity: 9 + 8 + 9 = 26\n\nThe value (the absolute value of the total beauty) + (the absolute value of\nthe total tastiness) + (the absolute value of the total popularity) here is 13\n+ 17 + 26 = 56. This is the maximum value.\n\n* * *"}, {"input": "5 3\n    1 -2 3\n    -4 5 -6\n    7 -8 -9\n    -10 11 -12\n    13 -14 15", "output": "54\n    \n\nConsider having the 1-st, 3-rd and 5-th kinds of cakes. The total beauty,\ntastiness and popularity will be as follows:\n\n  * Beauty: 1 + 7 + 13 = 21\n  * Tastiness: (-2) + (-8) + (-14) = -24\n  * Popularity: 3 + (-9) + 15 = 9\n\nThe value (the absolute value of the total beauty) + (the absolute value of\nthe total tastiness) + (the absolute value of the total popularity) here is 21\n+ 24 + 9 = 54. This is the maximum value.\n\n* * *"}, {"input": "10 5\n    10 -80 21\n    23 8 38\n    -94 28 11\n    -26 -2 18\n    -69 72 79\n    -26 -86 -54\n    -72 -50 59\n    21 65 -32\n    40 -94 87\n    -62 18 82", "output": "638\n    \n\nIf we have the 3-rd, 4-th, 5-th, 7-th and 10-th kinds of cakes, the total\nbeauty, tastiness and popularity will be -323, 66 and 249, respectively.  \nThe value (the absolute value of the total beauty) + (the absolute value of\nthe total tastiness) + (the absolute value of the total popularity) here is\n323 + 66 + 249 = 638. This is the maximum value.\n\n* * *"}, {"input": "3 2\n    2000000000 -9000000000 4000000000\n    7000000000 -5000000000 3000000000\n    6000000000 -1000000000 8000000000", "output": "30000000000\n    \n\nThe values of the beauty, tastiness and popularity of the cakes and the value\nto be printed may not fit into 32-bit integers."}]