use std::error::Error;
use std::io::prelude::*;
use std::io::{stdin, stdout, BufReader, BufWriter};

fn main() -> Result<(), Box<dyn Error>> {
    let stdin = stdin();
    let stdout = stdout();
    let mut writer = BufWriter::new(stdout.lock());
    let mut reader = BufReader::new(stdin.lock());
    solve(&mut writer, &mut reader)?;
    Ok(())
}

fn solve<W: Write, R: Read>(writer: &mut W, reader: &mut R) -> std::io::Result<()> {
    let mut s = String::new();
    reader.read_to_string(&mut s)?;
    let mut s = s.split_whitespace();
    let a: i32 = s.next().unwrap().parse().unwrap();
    let b: i32 = s.next().unwrap().parse().unwrap();
    if a < 10 && b < 10 {
        writer.write_all(format!("{}", a * b).as_bytes())?;
    } else {
        writer.write_all(b"-1")?;
    }
    Ok(())
}

macro_rules! make_test {
    ($name:ident, $input:expr, $output:expr ) => {
        #[test]
        fn $name() {
            use std::io::Cursor;
            use std::str::from_utf8;

            let mut writer = Cursor::new(vec![]);
            let mut reader = Cursor::new($input);

            solve(&mut writer, &mut reader).unwrap();

            assert_eq!(
                &writer.get_ref(),
                &$output,
                "\n  left: `{}`\n right: `{}`\n",
                from_utf8(&writer.get_ref()).unwrap(),
                from_utf8($output).unwrap()
            );
        }
    };
}

make_test!(test2, b"2 5", b"10");
