import java.io.*; import java.net.*; import java.util.StringTokenizer; public class Asona4{ public static void main(String argumendid[]) throws IOException{ BufferedReader klaviatuur=new BufferedReader( new InputStreamReader(System.in) ); System.out.println("Palun URL:"); String url=klaviatuur.readLine(); System.out.println("Palun täht"); String taht=klaviatuur.readLine(); BufferedReader sisse=new BufferedReader( new InputStreamReader( new URL(url).openConnection(). getInputStream() ) ); String rida=sisse.readLine(); while(rida!=null){ StringTokenizer st=new StringTokenizer(rida, " "); while(st.hasMoreTokens()){ String sona=st.nextToken(); if(sona.startsWith(taht))System.out.println(sona); } rida=sisse.readLine(); } } }