bit the bullet and dove into restrictions using Java Stacks