#include <bits/stdc++.h>

#define oo 1000000007
#define maxN 100005
#define debug(a) cout << #a << " = " << a << endl
#define fdebug(a, x, y)  { cout << #a << " : "; fto(_, x, y) cout << a[_] << ' '; cout << endl; }
#define fto(i, x, y) for(int i = (x); i != (y) + (((x) < (y) ? 1 : -1)); i += ((x) < (y)) ? 1 : -1)
#define ftoa(i, x, y, a) for(int i = (x); i != (((x) < (y)) ? (((y)-(x))/a+1)*a+(x) : (x)-(((x)-(y))/a+1)*a); i += ((x) < (y)) ? (a) : -(a))
#define mp make_pair
#define pb push_back
#define pf push_front
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define ull unsigned long long
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define FF first
#define SS second
#define mt make_tuple
#define eb emplace_back

using namespace std;

int main() {
    #ifndef ONLINE_JUDGE
        freopen("template.inp", "r", stdin);
        freopen("template.out", "w", stdout);
    #endif // ONLINE_JUDGE

    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);

    ftoa (i, n, m, k) cout << i << " ";
    puts("");
    ftoa (i, m, n, k) cout << i << " ";

    #ifndef ONLINE_JUDGE
        cout << endl;
        cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif

    return 0;
}

