import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int[] ints = new int[]{2,5,1,6,8,3,2,0,-3};
        quickSort(ints, 0 , ints.length - 1);
        System.out.println(Arrays.toString(ints));
    }

    public static void quickSort(int[] arr, int left, int right){
        if (left >= right){
            return;
        }
        int l = left;
        int r = right;
        while (l < r){
            while (l < r && arr[r] >= arr[left]) r--;
            while (l < r && arr[l] <= arr[left]) l++;
            if (r == l){
                int temp = arr[r];
                arr[r] = arr[left];
                arr[left] = temp;
            } else {
                int temp = arr[r];
                arr[r] = arr[l];
                arr[l] = temp;
            }
        }
        quickSort(arr, left, l - 1);
        quickSort(arr, r + 1, right);
    }
}