#include #include #include #include #include #include using namespace std; typedef long long int lint; int main() { int A, B; cin >> A >> B; int cnt = 0; int C = (A + 1) * (B + 1)+1; vectorvec(C); for (int ia = 0; ia <= A; ia++) { for (int ib = 0; ib <= B; ib++) { vec.at(cnt) = ia + ib * 5; cnt++; } } vec.at(C - 1) = 100000000; sort(vec.begin(), vec.end()); /*for (int ic = 0; ic < C; ic++) { cout << vec.at(ic) << ' '; }*/ for (int id = 1; id < C - 1; id++) { if (vec.at(id - 1) != vec.at(id) && vec.at(id) != vec.at(id + 1)) { cout << vec.at(id) << endl; } else { vec.at(id) -= 10000000; } } }