#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    set<int> ans;
    int a, b;
    cin >> a >> b;
    for (int i = 0; i <= a; i++) {
        for (int j = 0; j <= b; j++) {
            if (i == 0 && j == 0) {
                continue;
            }
            ans.insert(i + j * 5);
        }
    }

    for (auto it = ans.begin(); it != ans.end(); it++) {
        cout << *it << endl;
    }

    return 0;
}