#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, a;
  cin >> n >> a;
  double v1, v2, v3, ans, x, y, z, en = 1000000000;
  ans = 180 * (n - 2) / n;
  for (int i = 3; i <= n; i++) {
    double sum_l = (180 * (n - i) - ans * (n - i)) / 2;
    v1 = ans - sum_l;
    double sum_r = (180 * (i - 1 - 2) - ans * (i - 3)) / 2;
    v2 = ans - sum_r;
    v3 = ans - (sum_l + sum_r);
    if (abs(v1 - a) < en) x = 2, y = 1, z = i, en = abs(v1 - a);
    if (abs(v2 - a) < en) x = 1, y = 2, z = i, en = abs(v2 - a);
    if (abs(v3 - a) < en) x = 1, y = i, z = 2, en = abs(v3 - a);
  }
  cout << x << ' ' << y << ' ' << z;
}
