#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  int n, a, c, d, k = 0;
  cin >> n >> a;
  c = floorl(n * a / 180.l);
  if (c > n - 2) c = n - 2;
  if (c < 1) c = 1;
  d = ceill(n * a / 180.l);
  if (d > n - 2) d = n - 2;
  if (d < 1) d = 1;
  if (abs(c * 180.l / n - a) > abs(d * 180.l / n - a)) swap(c, d);
  cout << "1 2 " << n - c + 1 << '\n';
  return 0;
}
