import sequtils,strutils,algorithm,math,future,macros template get*():string = stdin.readLine().strip() template `min=`*(x,y:typed):void = x = min(x,y) let V = get().split().map(parseInt).sorted(cmp) # 4 * [1,30] const INF = 1e6.int var ans = INF # 30 * 30 * 30 for A in 1..V.max(): for B in 1..