'use strict';
(function(stdin) {

  var a  = stdin.toString().trim().split('\n'); 
  var b  = stdin.toString().trim().split('\n');

  console.log(a * b, (a + b) * 2);


}(require('fs').readFileSync('/dev/stdin', 'utf8')));