#include #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int a, b; cin >> a >> b; vector ans; for (int i = 0; i <= a; ++i) { for (int j = 0; j <= b; ++j) { int k = i * 1 + j * 5; ans.push_back(k); if (k == 0) ans.pop_back(); } } sort(all(ans)); auto result = unique(all(ans)); ans.erase(result, ans.end()); rep(i, ans.size()) cout << ans[i] << endl; return 0; }