public static void sort(Stack sortingStack) {
		if (sortingStack.top == null) return;
		Stack newStack = new Stack();
		newStack.push(sortingStack.pop());
		stacks.add(newStack);
		while (sortingStack.top != null) {
			int d = sortingStack.pop();
			boolean minStack = false;
			for(Stack s : stacks) {
				if (d < s.top.data) {
					s.push(d);
					minStack = true;
					break;
				}
			}
			if (!minStack) { 
				Stack maxStack = new Stack();
				maxStack.push(d);
				stacks.add(maxStack);
			}
		}
		for (Stack s : stacks) {
			while (s.top != null) {
				originalStack.push(s.pop());
			}
		}
	}