← Back to List

31262번: ПОДАРЪК ↗

Solutions

Python 3
562 B | 562 chars
import sys
from math import sqrt, pi, sin, factorial, ceil, floor
from decimal import Decimal
BLANK = " "

# inp = input
inp = lambda : sys.stdin.readline()[:-1].strip()
mii = lambda x = BLANK : [*map(int,inp().split(x))]
mfi = lambda x = BLANK : [*map(float,inp().split(x))]
ii = lambda : int(inp())
fi = lambda : float(inp())
p = print


def solve():
  s = list(input())
  a = sorted(s[:3])
  b = sorted(s[3:], reverse=True)
  
  for i in range(3):
    p(end=a[i]+b[i])
  
if __name__ == "__main__":
  tc = 1

  for t in range(1, tc+1):
    ret = solve()