#include <bits/stdc++.h>
using namespace std;
int main() {
  float n, a, i, x, p, q, l;
  cin >> n >> a;
  x = 180 / n;
  l = 0;
  for (i = x; i <= (180 - (360 / n)); i += x) {
    l++;
    if (i >= a) {
      p = a - i;
      if (p < 0) p *= -1;
      q = a - (i - x);
      if (q < 0) q *= -1;
      cout << 2 << ' ' << 1 << ' ';
      if (p <= q)
        cout << l + 2;
      else {
        if (l == 1) l++;
        cout << l + 1;
      }
      return 0;
    }
  }
  cout << 2 << ' ' << 1 << ' ' << n;
  return 0;
}
