#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
double x[100010], y[100010];
struct Vector2D {
  double x;
  double y;
};
int n, a;
double deg;
double get_vector_length(Vector2D v) {
  return pow((v.x * v.x) + (v.y * v.y), 0.5);
}
double dot_product(Vector2D vl, Vector2D vr) {
  return vl.x * vr.x + vl.y * vr.y;
}
double AngleOf2Vector(Vector2D A, Vector2D B) {
  double length_A = get_vector_length(A);
  double length_B = get_vector_length(B);
  double cos_sita = dot_product(A, B) / (length_A * length_B);
  double sita = acos(cos_sita);
  sita = sita * 180.0 / 3.141592653589793;
  return sita;
}
double calc_angle(int a, int b) {
  Vector2D vecA, vecB;
  vecA.x = x[1] - x[a];
  vecA.y = y[1] - y[a];
  vecB.x = x[b] - x[a];
  vecB.y = y[b] - y[a];
  double angle = AngleOf2Vector(vecA, vecB);
  return angle;
}
double toRad(double deg) { return deg * 3.141592653589793 / 180.0; }
bool C(int a, int b) {
  if (calc_angle(a, b) > deg)
    return true;
  else
    return false;
}
signed main() {
  cin >> n >> a;
  deg = (double)a;
  for (long long i = (0); i < (n); i++) {
    x[i + 1] = cos(toRad(360.0 / n * i));
    y[i + 1] = sin(toRad(360.0 / n * i));
  }
  double min_sa = 900.0;
  int ansA, ansB;
  for (int A = 2; A <= n - 1; A++) {
    int lb = A + 1, ub = n;
    while (ub - lb > 1) {
      int mid = (lb + ub) / 2;
      if (C(A, mid))
        lb = mid;
      else
        ub = mid;
    }
    for (int idx = lb - 3; idx <= lb + 3; idx++) {
      if (A + 1 <= idx && idx <= n) {
        if (abs(calc_angle(A, idx) - deg) < min_sa) {
          ansA = A;
          ansB = idx;
          min_sa = abs(calc_angle(A, idx) - deg);
        }
      }
    }
  }
  cout << 1 << " " << ansA << " " << ansB << endl;
}
