#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, angle, a = 1, b = 2, c = 3;
  cin >> n >> angle;
  double mini = 360;
  double tempangle = ((2 * n - 4) * 90) / n;
  double dec = (((2 * n - 4) * 90) / n) / (n - 2);
  for (int i = 3; i <= n; i++) {
    if (abs(tempangle - angle) < mini) {
      mini = abs(tempangle - angle);
      c = i;
    }
    tempangle -= dec;
  }
  cout << a << " " << b << " " << c;
}
