#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 500;
const long long mod = 1e9 + 7;
const long long INF = 1LL << 57LL;
long long expo(long long a, long long b) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return expo(a * a, b / 2);
  else
    return a * expo(a * a, b / 2);
}
long long hcf(long long a, long long b) {
  a = abs(a);
  b = abs(b);
  return (b == 0) ? a : hcf(b, a % b);
}
long long abs(long long a, long long b) {
  if (a > b) return a - b;
  return b - a;
}
double absd(double a, double b) {
  if (a > b) return a - b;
  return b - a;
}
int dp[110][10010];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  int n;
  double angle, sumOfAngle;
  cin >> n >> angle;
  sumOfAngle = 180 * 1.0;
  sumOfAngle /= n;
  double minn = 99999999.0;
  int ans = 0;
  for (int i = 1; i <= n - 2; i++) {
    if (minn > absd(sumOfAngle * i, double(angle))) {
      minn = absd(sumOfAngle * i, double(angle));
      ans = i + 2;
    }
  }
  cout << "2 1 " << ans;
  return 0;
}
