public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] prices = Arrays.stream(in.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
int[] sushi = solveSushi(prices);
for (int i : sushi) {
System.out.printf("%d ", i);
}
}
private static int[] solveSushi(int[] prices) {
int len = prices.length;
int[] pricesDis = new int[len * 2];
for (int i = 0; i < pricesDis.length; i++) {
pricesDis[i] = prices[i % len]; //给新数组赋值,模拟转盘
}
for (int i = 0; i < len; i++) {
for (int j = i + 1; j < i + len; j++) {
if (pricesDis[j] < pricesDis[i]) {
prices[i] = pricesDis[j] + pricesDis[i];
break;
}
}
}
return prices;
}
}