#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, val, o, a, ans;
  long long int sol = 4;
  cin >> n >> val;
  o = ((180 * 1.0) * (n - 2 * 1.0)) / n;
  a = o / ((n - 3) * 1.0 + 1 * 1.0);
  double temp = a;
  for (long long int i = 4; i <= n; i++) {
    if (i == 4) {
      if (a > val)
        ans = a - val;
      else
        ans = val - a;
    } else {
      if (a > val) {
        if (ans > a - val) {
          ans = a - val;
          sol = i;
        }
      } else {
        if (ans > val - a) {
          ans = val - a;
          sol = i;
        }
      }
    }
    a = a + temp;
  }
  if (val > o)
    val = val - o;
  else
    val = o - val;
  if (ans < val)
    cout << "2 1 " << sol - 1 << "\n";
  else
    cout << "1 2 3\n";
}
