#include <vector>
#include <iostream>

using namespace std;

int a[] = {2, 6, 3, 7, 3};

struct Elem
{
    int val;
    int sum;
};

vector < Elem > v;

int build(int i)
{
    if (i == 5)
        return 0;
    v.push_back(Elem());
    Elem & x = v.back();
    x.val = a[i];
    x.sum = a[i] + build(i + 1);
    return x.sum;
}

int main()
{
    build(0);
    for (Elem elem : v)
        cout << elem.val << " " << elem.sum << "\n";
    return 0;
}
