#include <bits/stdc++.h>
#include "testlib.h"
 
using namespace std;

string mult(string x, string y) {
    reverse(x.begin(), x.end());
    reverse(y.begin(), y.end());
    vector<int> res(x.size() + y.size() - 1);
    for (int i = 0; i < x.size(); ++i) {
        for (int j = 0; j < y.size(); ++j) {
            res[i + j] += (int) (x[i] - '0') * (y[j] - '0');
        }
    }
    int carry = 0;
    string ans;
    for (int i = 0; i < res.size() || carry; ++i) {
        if (i < res.size()) {
            carry += res[i];
        }
        ans += '0' + carry % 10;
        carry /= 10;
    }

    reverse(ans.begin(), ans.end());
    return ans;
}

const int MAXL = 100'000;
 
int main(int argc, char *argv[]) {
    registerValidation(argc, argv);
    string ab = inf.readToken(format("[0-9]{1,%d}", MAXL), "ab");
    inf.readSpace();
    string c = inf.readToken(format("[0-9]{1,%d}", MAXL), "c");
    inf.readEoln();
    inf.readEof();

    int la = ab.size() + c.size();
    if (la % 2) {
        --la;
    }
    la /= 2;

    ensure(la < ab.size());

    string a = ab.substr(0, la);
    string b = ab.substr(la);

    pattern number("[1-9][0-9]*");

    ensure(number.matches(a));
    ensure(number.matches(b));
    ensure(number.matches(c));

    ensure(mult(b, c) == a);
}
