// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Lotto1 {
    private static final int PICKS = 6;
    private static final int MAX = 20;
    public static void main(String[] args) {
        Random rng = new Random();
        ArrayList<Integer> lst = new ArrayList<>();
        for(int i = 0; i < PICKS; i++) {
            int v;
            do {
                v = rng.nextInt(MAX) + 1;
            } while(lst.contains(v));
            lst.add(v);
        }
        Collections.sort(lst);
        for(int v : lst) {
            System.out.println(v);
        }
    }
}
