/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package game; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; /** * * @author cteam063 */ public class Game { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String row1 = in.readLine(); int num = Integer.parseInt(row1); ArrayList stacks=new ArrayList<>(); StringTokenizer row2 = new StringTokenizer(in.readLine()); for (int i = 0; i