include <bits/stdc++.h>
define fore(i, l, r) for(int i = int(l); i < int(r); i++)
define forn(i, n) fore(i, 0, n)
define all(a) (a).begin(), (a).end()
define sqr(a) ((a) * (a))
define sz(a) int(a.size())
define mp make_pair
define pb push_back
define x first
define y second
using namespace std;
template<class A, class B> ostream& operator << (ostream &out, const pair<A, B> &p) { return out << "(" << p.first << ", " << p.second << ")"; }
template ostream& operator << (ostream &out, const vector &v) { out << "["; forn(i, sz(v)) { if(i > 0) out << " "; out << v[i]; } return out << "]"; }
typedef long long li; typedef long double ld; typedef pair<int, int> pt;
inline int gett() { return clock() * 1000 / CLOCKS_PER_SEC; }
const ld EPS = 1e-9; const int INF = int(1e9); const li INF64 = li(INF) * INF; const ld PI = 3.1415926535897932384626433832795;
int n, a;
inline bool read() { if(!(cin >> n >> a)) return false;
return true;
}
inline void solve() { int base = n * a / 180; base = max(1, min(n — 2, base));
int bk = base;
for(int ck = max(1, base - 2); ck <= min(n - 2, base + 2); ck++) {
if(abs(180 * ck - n * a) < abs(180 * bk - n * a))
bk = ck;
}
cout << 2 << " " << 1 << " " << bk + 2 << endl;
}
int main(){
ifdef _DEBUG freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout);
int t = gett();
endif
srand(time(NULL));
cout << fixed << setprecision(10);
while(read()) {
solve();
ifdef _DEBUG cerr << "TIME = " << gett() — t << endl; t = gett();
endif
}
return 0;
}