#include <stdio.h>
#include <math.h>

int main () {
    FILE* in = stdin;
    FILE* out = stdout;
    int b,w,s;

    fscanf (in, "%d %d", &b, &w);
    s = sqrt ((b == w ? b + w : b < w ? 2 * b + 1 : 2 * w + 1) + 1e-9);
    if (s == 0) fprintf (out, "Impossible\n");
    else fprintf (out, "%d\n", s);

    fclose (in);
    fclose (out);
    return 0;
}
