#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
const long long INF = 1e18 + 7;
const long double EPS = 1e-7;
const long double PI = 3.14159265358979323;
struct Point {
  long double x, y;
  Point(long double _x = 0, long double _y = 0) {
    x = _x;
    y = _y;
  }
  Point operator-(const Point &p) { return Point(x - p.x, y - p.y); }
  Point operator+(const Point &p) { return Point(x + p.x, y + p.y); }
  long long operator*(const Point &p) { return x * p.x + y * p.y; }
  long long operator^(const Point &p) { return x * p.y - y * p.x; }
  bool operator==(const Point &p) { return x == p.x && y == p.y; }
  bool operator>(const Point &p) { return tie(x, y) > tie(p.x, p.y); }
  long double len2() { return x * x + y * y; }
  long double len() { return sqrt(len2()); }
};
Point operator/(const Point &p, long long a) { return Point(p.x / a, p.y / a); }
bool operator>=(Point a, Point b) { return a > b || a == b; }
Point zero;
bool operator<(Point a, Point b) {
  a = a - zero;
  b = b - zero;
  long long p = a ^ b;
  if (p != 0) {
    return p > 0;
  } else {
    return a.len2() < b.len2();
  }
}
istream &operator>>(istream &in, Point &p) {
  in >> p.x >> p.y;
  return in;
}
ostream &operator<<(ostream &out, Point &p) {
  out << p.x << ' ' << p.y;
  return out;
}
bool each_line(Point a, Point b, Point c, Point d) {
  Point ab = b - a, ac = c - a, ad = d - a;
  return !(ab ^ ac) && !(ab ^ ad);
}
long long rot(Point a, Point b, Point c) {
  Point v1 = b - a, v2 = c - b;
  long long p = v1 ^ v2;
  if (!p) {
    return p;
  } else if (p > 0) {
    return 1;
  } else {
    return -1;
  }
}
bool intersection(Point a, Point b, Point c, Point d) {
  return rot(a, b, c) * rot(a, b, d) <= 0 && rot(c, d, a) * rot(c, d, b) < 0;
}
Point intersection_point(Point a, Point b, Point c, Point d) {
  long double t = ((d - c) * (c - a)) / ((d - c) * (b - a));
  return a * (b - a) * t;
}
long double dist(Point a, Point b, Point c) {
  return abs(((b - a) ^ (c - a)) / (b - a).len());
}
long double distance(Point a, Point b, Point c) {
  Point ab = b - a, ac = c - a;
  Point ba = a - b, bc = c - b;
  if (ab * ac < 0) {
    return abs(ac.len());
  } else if (ba * bc < 0) {
    return abs(bc.len());
  } else {
    return dist(a, b, c);
  }
}
vector<long long> ans;
signed main() {
  {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(11);
  };
  long long n;
  long double a, mn = INF;
  cin >> n >> a;
  ans.emplace_back(2);
  ans.emplace_back(1);
  ans.emplace_back(3);
  long double k = (n - 2) * 180;
  long double q = k / (n * 1.0);
  long double p = 180.0 / n;
  for (long long i = 1; i <= n - 2; ++i) {
    long double m = p * i;
    if (abs(a - m) < mn) {
      ans[2] = i + 2, mn = abs(a - m);
    }
  }
  for (auto &i : ans) {
    cout << i << ' ';
  }
  return 0;
}
