import java.util.*;
public class Main {
public static void main(String[] args) {
// Harbor, Week 1, Mock 1, PR_PracticeTest_1.pdf
// AP CS A
// MCQ 29
ArrayList <Integer> alist5 = new ArrayList<Integer>();
int[] a1 = {21, 6, 2, 8, 1};
for (int a: a1)
{
alist5.add(a);
}
for (int k = 0; k < alist5.size() - 1; k++)
{
for (int i = 0; i < alist5.size() - 2; i++)
{
if (alist5.get(i) > alist5.get(i + 1))
{
int hold = alist5.remove(i);
alist5.add(i + 1, hold);
}
}
}
System.out.println(alist5);
}
}