#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
	int test[] = { 0 ,1 ,2, 3, 4, 5, 6, 7, 8, 9};
	int testTo[] = { -1 ,-1 ,-1, -1, -1, -1, -1, -1, -1, -1};
	int len = 10;
	int block = 3;
	int counter = 0;
	for (int i = 0; i < len; i = i + block*2)
	   for (int y = 0; y < block; y++)
	      for (int z = 0; z < 2; z++)
	      {
	         int index = i + y + z*block;
	         if (index < len)
	            testTo[counter++] = test[index];
	      }
      
	for	(int i = 0; i < len; i++)
	   cout << testTo[i] << "  ";
	return 0;
}