#include <cstdio>

int main()
{
  freopen("numbers.in", "r", stdin);
  freopen("numbers.out", "w", stdout);

  int a, b, M = 100;
  scanf("%d%d", &a, &b);

  for (int x = -M; x <= M; x++)
    for (int y = -M; y <= M; y++)
      if (a * x + b * y == 1)
      {
        printf("%d %d\n", x, y);
        return 0;
      }
  puts("0 0");
  return 0;
}