#include <bits/stdc++.h>
using namespace std;
int main() {
  short a, b;
  short n1 = 0, n2 = 0, n3 = 0;
  cin >> a >> b;
  if (a == b)
    cout << n1 << ' ' << 6 << ' ' << n3;
  else {
    if ((a + b) % 2 == 0) {
      n2++;
      for (short i = 0; i < (a + b) / 2 - 1; i++) {
        if (a < b)
          n1++;
        else
          n3++;
      }
      if (n3 == 0)
        n3 = 6 - n1 - n2;
      else
        n1 = 6 - n3 - n2;
    } else {
      n2 = 0;
      for (short i = 0; i < (a + b) / 2; i++) {
        if (a < b)
          n1++;
        else
          n3++;
      }
      if (n3 == 0)
        n3 = 6 - n1 - n2;
      else
        n1 = 6 - n3 - n2;
    }
    cout << n1 << ' ' << n2 << ' ' << n3;
  }
  return 0;
}
