#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int x = min(a, b), y = max(a, b);
  if (a == b)
    printf("0 6 0");
  else if (x == a)
    printf("%d %d %d", x + (y - x + 1) / 2 - 1, (y - x + 1) % 2,
           6 - (x + (y - x + 1) / 2 - 1) - ((y - x + 1) % 2));
  else
    printf("%d %d %d", 6 - (x + (y - x + 1) / 2 - 1) - ((y - x + 1) % 2),
           (y - x + 1) % 2, x + (y - x + 1) / 2 - 1);
}
