import java.net.*;
import java.util.*;

public class URLGet
{
	public static void main(String[] argv)throws Exception
	{
		String categoria = argv[0];// = new String("ristoranti");
		String citta = argv[1];// = new String("savona");
		URL googlemaps = new URL("http://maps.google.it/maps?f=q&hl=it&geocode=&q=" + categoria + "+" + citta + "&ie=UTF8&sa=N&start=0");
		URLConnection gm = googlemaps.openConnection();
		Scanner sc = new Scanner(gm.getInputStream());
		String input;
		StringTokenizer st;
		String s;
		while(sc.hasNext())
		{
			input = sc.nextLine();
			if(input.contains("laddr"))
			{
				st = new StringTokenizer(input, "\"");
				boolean found=false;
				while(st.hasMoreTokens())
				{
					s = st.nextToken();
					if(found)
					{
						System.out.println(s);
						found=false;
					}
					if(s.contains("laddr"))
						found=true;
				}
			}
		}
	}
}
