#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" #define rep(i,n) for(int i = 0;i < n;i++) #define REP(i,n,k) for(int i = n;i < k;i++) #define P(p) cout<<(p)<> ret; return ret; } ull gcd(ull a, ull b){ if (b > a)swap(a, b); if (b == 0) return a; return gcd(b, a%b); } ll f[] = { 3, 5, 17, 257, 65537 }; void solve() { ull n, m; cin >> n >> m; ull g = gcd(n, m); n /= g; m /= g; ull tmp = m; while (tmp % 2 == 0){ tmp /= 2; } while (tmp % 5 == 0){ tmp /= 5; } if (tmp == 1){ cout << setprecision(20) << fixed; string ans = to_string(((double)n / (double)m)*10000000000000000); for (int i = ans.length()-1; i >= 0; i--){ if (ans[i] != '0' && ans[i] != '.'){ P(ans[i]); return; } } } else{ P(-1); } } int main() { solve(); return 0; }