1. 


/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10106 (Product)
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1047
*
* @author Christian Posselt
* @author Jonathan Schubert
* @version 1.0, 05/21/2009
*
* Status : Accepted
* Runtime: 0.088
*/

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main
{

public static void main(String[] args) throws IOException
{
//set up all variables needed
StringBuilder bu = new StringBuilder();
BufferedReader Reader = new BufferedReader(new InputStreamReader(System.in));
BigInteger facA, facB;

while(true)
{

String line = Reader.readLine();

if(line == null)
break;

//read-in factorsA and B
facA = new BigInteger(line);
facB = new BigInteger(Reader.readLine());

//append
bu.append(facA.multiply(facB).toString() + "\n");
}

//print result
System.out.print(bu.toString());
}

}


2.


/* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10106 (Product)
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1047
*
* @author Dennis Wilfert
* @author Johann Studt
* @version 1.0, 05/21/2009
*
* Status : Accepted
* Runtime: 0.104
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Scanner;


public class Main {

public static void main(String[] args) {


Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
StringBuilder output = new StringBuilder();

while(scanner.hasNextLine())
// Jeweils eine Zeile mit der nächsten multiplizieren
output.append(new BigInteger(scanner.nextLine()).multiply(new BigInteger(scanner.nextLine())) + "\n");

System.out.print(output);
}

}