#include<stdio.h>

int min(int a, int b)
{
     return a < b ? a : b;
}
int max(int a, int b)
{
     return a > b ? a : b;
}
int main()
{
    long x1, y1, x2, y2, x3, y3, count;
    scanf("%ld %ld", &x1, &y1);
    scanf("%ld %ld", &x2, &y2);
    scanf("%ld %ld", &x3, &y3);

if(x1==x2 && x2==x3)
		count=1;

	else if(y1==y2 && y2==y3)
		count=1;

	else if(x1==x2 && (y3<=min(y1,y2) || max(y1,y2)<=y3))
		count=2;

	else if(x1==x3 && (y2<=min(y1,y3) || max(y1,y3)<=y2))
		count=2;

	else if(x2==x3 && (y1<=min(y2,y3) || max(y2,y3)<=y1))
		count=2;

	else if(y1==y2 && (x3<=min(x1,x2) || max(x1,x2)<=x3))
		count=2;

	else if(y1==y3 && (x2<=min(x1,x3) || max(x1,x3)<=x2))
		count=2;

	else if(y2==y3 && (x1<=min(x2,x3) || max(x2,x3)<=x1))
		count=2;

	else
		count=3;

    printf("%ld", count);
    return 0;
}

#include<stdio.h>
int m[5][5];
int cap(int n);
int iguales(int i);
int min(int x,int y);
int max(int x,int y);
int into(int v, int x, int y);
int ret(int n,int x,int y, int z);
int main(){
    scanf("%d %d %d %d %d %d",&m[0][0],&m[1][0],&m[0][1],&m[1][1],&m[0][2],&m[1][2]);
    if(iguales(0) || iguales(1)){
        printf("1");
    }else if(cap(0) || cap(1)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales(int i){
    return m[i][0]==m[i][1] && m[i][1]==m[i][2];
}
int cap(int n){
    return ret(n,0,1,2) || ret (n,1,2,0) || ret (n,2,0,1);
}
int ret(int n,int x,int y, int z){
    return m[n][x]==m[n][y] && !into(m[!n][z],m[!n][x],m[!n][y]);
}
int into(int v, int x, int y){
    return v>min(x,y) && v<max(x,y);
}
int min(int x,int y){
    if(x<y){
        return x;
    }else{
        return y;
    }
}
int max(int x,int y){
    if(x>y){
        return x;
    }else{
        return y;
    }
}

#include <stdio.h>
#include <string.h>
#include <stdbool.h>

#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)

int n = 3, flag = 3, X[10], Y[10];

void run(){
    int i, j, k;
    if (X[0] == X[1] && X[1] == X[2]) flag = 1;
    else{
        for (i = 0; i < n; i++){
            for (j = i + 1; j < n; j++){
                for (k = 0; k < n; k++){
                    if (k == i || k == j) continue;
                    if (Y[i] == Y[j] && ((X[k] <= X[i] && X[k] <= X[j]) || (X[k] >= X[i] && X[k] >= X[j]))){
                        flag = 2;
                    }
                }
            }
        }
    }
}

int main(){
    int i, j, k;
    for (i = 0; i < n; i++) scanf("%d %d", &X[i], &Y[i]);

    run();
    if (flag != 1){
        for (i = 0; i < n; i++) k = X[i], X[i] = Y[i], Y[i] = k;
        run();
    }

    printf("%d\n", flag);
    return 0;
}

#include <stdio.h>

int min(int a, int b)
{
	return a<b?a:b;
}

int max(int a, int b)
{
	return a>b?a:b;
}

int bw(int i, int j, int k)
{
	 return min(i,j) <=k && k <=max(i,j);
}

int f(int x[],int y[],int i, int j, int k)
{
	return (x[k] == x[i] || x[k] == x[j]) && bw(y[i],y[j],y[k]) ||
		(y[k] == y[i] || y[k] == y[j]) && bw(x[i],x[j],x[k]);
}

int main()
{
	int x[3],y[3];
	int i;
	for(i=0;i<3;i++)
	{
		scanf("%d %d",&x[i],&y[i]);
	}

	int ans = 0;int flag=0;
	if((x[0] == x[1] && x[1] == x[2]) || (y[0] == y[1] && y[1] == y[2]))
		ans = 1;
	else
	{
		if(f(x,y,0,1,2) || f(x,y,0,2,1) || f(x,y,1,2,0))
			ans = 2;
		else
			ans = 3;
	}

	printf("%d",ans);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef long long int LLI;

#define TRUE              (1==1)
#define FALSE             (!TRUE)
#define fo3(i,a,b)        for(i=((int)a);i<=((int)b);i++)
#define of3(i,a,b)        for(i=((int)a);i>=((int)b);i--)
#define in1(n)            scanf("%d",&(n))
#define LL1(n)            scanf("%I64d",&(n))
#define in2(n,m)          scanf("%d%d",&(n),&(m))
#define pri(n)            printf("%d\n",n)
#define prs(n)            printf("%s\n",n)
#define prL(n)            printf("%I64d\n",n)
#define strin(n)          scanf("%s",n)
#define newint(n)         (int*)calloc((n),sizeof(int))
#define arrint(ret,n,i)   fo3(i,1,n) in1(ret[i-1])
#define newLLI(n)         (LLI*)calloc((n),sizeof(LLI))
#define arrLLI(ret,n,i)   fo3(i,1,n) LL1(ret[i-1])

void fastWrite(FILE * ofp, int x) {
    int i = 12;
    char buff[i];
    buff[i] = 0;
    int neg = 0;
    if (x < 0){
        x = -x;
        neg = 1;
    }
    if (x == 0)
        buff[--i] = '0';
    else while (x != 0) {
        buff[--i] = (x % 10) + '0';
        x /= 10;
    }
    if (neg)
        buff[--i] = '-';
    fwrite(buff + i, sizeof(char), (12 - i), ofp);
}

void fastSpace(FILE * ofp){
    fwrite(" ", sizeof(char), 1, ofp);
}
void fastNewLine(FILE * ofp) {
    fwrite("\n", sizeof(char), 1, ofp);
}

typedef struct AL AL;
struct AL{
    int * vals;
    int size;
    int cap;
};
AL * ALCreate(int s) {
    AL * ret = (AL *) calloc(1, sizeof(AL));
    if (s == 0) ret->vals = NULL;
    else ret->vals = (int *) calloc(s, sizeof(int));
    ret->size = 0; ret->cap = s;
    return ret;
}
void ALAdd(AL * list, int ele) {
    if (list->cap == list->size) {
        int nC = ((list->cap << 1) | 1);
        list->vals = realloc(list->vals, sizeof(int) * nC);
        list->cap = nC;
    }
    list->vals[list->size++] = ele;
}

typedef struct Pair {
    int fi, se;
} Pair;

int comp(Pair ** arr, int f, int s) {// CHANGE THIS
    if (arr[f]->fi != arr[s]->fi)
        return arr[f]->fi - arr[s]->fi;
    return arr[f]->se - arr[s]->se;
}

void sort(Pair ** arr, int size) {
    int i;
    if (size < 6) {
        int nSize = 0;
        Pair * swp;
        while (size != 0) {
            nSize = 0;
            for (i = 0; i < size - 1; i++)
                if (comp(arr, i, i + 1) > 0) {
                    nSize = i + 1;
                    swp = arr[i];
                    arr[i] = arr[i + 1];
                    arr[i + 1] = swp;
                }
            size = nSize;
        }
        return;
    }
    Pair ** tmp = (Pair **)calloc(size, sizeof(Pair *)); // CHANGE THIS
    int lSize = (size >> 1);
    int rSize = size - lSize;
    sort(arr, lSize); sort(arr + lSize, rSize);
    int lPtr = 0, rPtr = 0;
    int ptr = 0;
    while (ptr != size) {
        if (lPtr == lSize){
            tmp[ptr] = arr[lSize + (rPtr++)];
        } else if (rPtr == rSize || comp(arr, lPtr, lSize + rPtr) <= 0){ // CHANGE THIS
            tmp[ptr] = arr[lPtr++];
        } else {
            tmp[ptr] = arr[lSize + (rPtr++)];
        }
        ptr++;
    }
    for (i = 0; i < size; i++)
        arr[i] = tmp[i];
    free(tmp);
}

int bc(int x) {
    if (x <= 1)
        return x;
    return (x&1) + bc(x>>1);
}

int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}

#define MAX        100000
#define NULL_CARRY -1
#define NULL_VALUE 0

LLI h1, h2;

int carry[4 * MAX];
int st[4 * MAX];
int en[4 * MAX];
LLI ans[2][4 * MAX];

void init2(int index, int s, int e) {
   //printf("%d %d %d\n", index, s, e);
   st[index] = s;
   en[index] = e;
   ans[0][index] = 0;
   ans[1][index] = 0;
   carry[index] = NULL_CARRY;
   if (s == e)
      return;
   int mid = (s + e) >> 1;
   init2(index << 1, s, mid);
   init2((index << 1) | 1, mid + 1, e);
}

// Inclusive s and e
void ITInit(int s, int e) {
   init2(1, s, e);
}

LLI fastExpo(LLI exp, LLI base, LLI mod) {
    if (exp == 0)
        return 1;
    if (exp == 1)
        return base % mod;
    LLI tmp = fastExpo(exp >> 1, base, mod);
    tmp *= tmp;
    tmp %= mod;
    if (exp & 1)
        tmp = (tmp * base) % mod;
    return tmp;
}

LLI aoMem[2][MAX + 10];
LLI feMem[2][MAX + 10];
void genAllOnes() {
    int i;
    LLI tmp1 = 0;
    LLI tmp2 = 0;
    LLI tmp3 = 1;
    LLI tmp4 = 1;
    fo3(i,0, MAX+9) {
        aoMem[TRUE][i] = tmp1;
        tmp1 = tmp1 * 10 + 1;
        tmp1 %= h1;
        aoMem[FALSE][i] = tmp2;
        tmp2 = tmp2 * 10 + 1;
        tmp2 %= h2;
        feMem[TRUE][i] = tmp3;
        tmp3 *= 10;
        tmp3 %= h1;
        feMem[FALSE][i] = tmp4;
        tmp4 *= 10;
        tmp4 %= h2;
    }
}
LLI allOnes(int len, LLI mod) {
    return aoMem[mod==h1][len];
}

LLI agg(int pre, int suf, int pow, LLI mod) {
    LLI mult = feMem[mod==h1][pow];
    mult *= suf;
    mult += pre;
    mult %= mod;
    //printf(" returning from agg!\n");
    return mult;
}

void ITComp(int index) {
    if (carry[index] == NULL_CARRY) {
        ans[0][index] = agg(ans[0][index<<1], ans[0][(index<<1)|1], en[index<<1] - st[index<<1] + 1, h1);
        ans[1][index] = agg(ans[1][index<<1], ans[1][(index<<1)|1], en[index<<1] - st[index<<1] + 1, h2);
    } else {
        ans[0][index] = allOnes(en[index] - st[index] + 1, h1) * carry[index];
        ans[0][index] %= h1;
        ans[1][index] = allOnes(en[index] - st[index] + 1, h2) * carry[index];
        ans[1][index] %= h2;
    }
}

void push(int index) {
    if (carry[index] == NULL_CARRY)
        return;
    if (st[index] != en[index]) {
        carry[index<<1] = carry[index];
        ITComp(index<<1);
        carry[(index<<1)|1] = carry[index];
        ITComp((index<<1)|1);
    }
    carry[index] = NULL_CARRY;
}

void set2(int index, int s, int e, int value) {
    if (st[index] >= s && e >= en[index]) {
        carry[index] = value;
        ITComp(index);
        return;
    }
    if (st[index] > e || s > en[index])
        return;
    push(index);
    set2(index<<1, s, e, value);
    set2((index<<1)|1, s, e, value);
    ITComp(index);
}

void ITSet(int s, int e, int value) {
   set2(1, s, e, value);
}

LLI get2(int index, int type, int s, int e) {
    if (st[index] >= s && e >= en[index]) {
        //printf(" Starting Push!\n");
        //push(index);
        ITComp(index);
        //printf(" Out of Push!\n");
        if (type == 0) {
            //prL(agg(0, ans[type][index], st[index] - s, h1));
            return agg(0, ans[type][index], st[index] - s, h1);
        }
        return agg(0, ans[type][index], st[index] - s, h2);
    }
    if (st[index] > e || s > en[index])
        return NULL_VALUE;
    push(index);
    LLI ret = get2(index<<1, type, s, e) + get2((index<<1)|1, type, s, e);
    if (type == 0 && ret >= h1)
        ret -= h1;
    if (type == 1 && ret >= h2)
        ret -= h2;
    return ret;
}

LLI get(int type, int s, int e) {
   return get2(1, type, s, e);
}

int check2a(LLI x1, LLI y1, LLI x2, LLI y2, LLI x3, LLI y3) {
    return (x1 == x2 && ((y3 >= y1 && y3 >= y2) || (y3 <= y1 && y3 <= y2)));
}
int check2(LLI x1, LLI y1, LLI x2, LLI y2, LLI x3, LLI y3) {
    if (check2a(x1, y1, x2, y2, x3, y3))
        return TRUE;
    if (check2a(x3, y3, x1, y1, x2, y2))
        return TRUE;
    if (check2a(x2, y2, x3, y3, x1, y1))
        return TRUE;
    if (check2a(y1, x1, y2, x2, y3, x3))
        return TRUE;
    if (check2a(y3, x3, y1, x1, y2, x2))
        return TRUE;
    if (check2a(y2, x2, y3, x3, y1, x1))
        return TRUE;
    return FALSE;
}

int main(void) {
    LLI x1,x2,x3,y1,y2,y3;
    LL1(x1);
    LL1(y1);
    LL1(x2);
    LL1(y2);
    LL1(x3);
    LL1(y3);
    if ((x1 == x2 && x2 == x3) || (y1 == y2 && y2 == y3)) {
        pri(1);
        return 0;
    }
    if (check2(x1,y1,x2,y2,x3,y3)){
        pri(2);
        return 0;
    }
    pri(3);
    return 0;
}

#include<stdio.h>
int fun(int a,int b,int c){
	if(b>c){
		int temp=c;
		c=b;
		b=temp;
	}
	if(a>=c||a<=b)
	return 1;
	else
	return 0;
}
main(){
	int x1,y1,x2,y2,x3,y3;
	scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
	if((x1==x2&&x1==x3)||(y1==y2&&y1==y3))
	printf("1");
	else if(x1==x2&&fun(y3,y1,y2))
	printf("2");
	else if(x1==x3&&fun(y2,y1,y3))
	printf("2");
	else if(x2==x3&&fun(y1,y2,y3))
	printf("2");
	else if(y1==y2&&fun(x3,x1,x2))
	printf("2");
	else if(y1==y3&&fun(x2,x1,x3))
	printf("2");
	else if(y2==y3&&fun(x1,x2,x3))
	printf("2");
	else
	printf("3");
}

#include<stdio.h>
int swap(int a,int d,int b,int e,int c,int f)
{
	if(a==b)
	{
		if((d<e&&f>d&&f<e)||(d>e&&f<d&&f>e))return 3;
		else return 2;
	}
	if(a==c)
	{
		if((d<f&&e>d&&e<f)||((d>f&&e<d&&e>f)))return 3;
		else return 2;
	}
	if(b==c)
	{
		if((e<f&&d>e&&d<f)||(e>f&&d<e&&d>f))return 3;
		else return 2;
	}
}
int main()
{
	int x1,y1,x2,y2,x3,y3;
	scanf("%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3);
	if(x1==x2&&x2==x3)printf("1\n");
	else if(x1!=x2&&x2!=x3&&x1!=x3)
	{
		if(y1==y2&&y2==y3)printf("1\n");
		else if(y1!=y2&&y2!=y3&&y3!=y1)printf("3\n");
		else	printf("%d\n",swap(y1,x1,y2,x2,y3,x3));
	}
	else printf("%d\n",swap(x1,y1,x2,y2,x3,y3));
	return 0;
}

#include<stdio.h>
int swap(int a,int b,int c,int d,int e,int f)
{
	if(a==b)
	{
		if(f>d&&f<e)return 3;
		else return 2;
	}
	if(a==c)
	{
		if(e>d&&f<f)return 3;
		else return 2;
	}
	if(b==c)
	{
		if(d>e&&f<f)return 3;
		else return 2;
	}
}
int main()
{
	int x1,y1,x2,y2,x3,y3;
	scanf("%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3);
	if(x1==x2&&x2==x3)printf("1\n");
	else if(x1!=x2&&x2!=x3&&x1!=x3)
	{
		if(y1==y2&&y2==y3)printf("1\n");
		else printf("%d\n",swap(y1,y2,y3,x1,x2,x3));
	}
	else printf("%d\n",swap(x1,x2,x3,y1,y2,y3));
	return 0;
}

#include<stdio.h>
int swap(int a,int b,int c,int d,int e,int f)
{
	if(a==b)
	{
		if(f>d&&f<e)return 3;
		else return 2;
	}
	if(a==c)
	{
		if(e>d&&f<f)return 3;
		else return 2;
	}
	if(b==c)
	{
		if(d>e&&f<f)return 3;
		else return 2;
	}
}
int main()
{
	int x1,y1,x2,y2,x3,y3;
	scanf("%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3);
	if(x1==x2&&x2==x3)printf("1\n");
	else if(x1!=x2&&x2!=x3&&x1!=x3)
	{
		if(y1==y2&&y2==y3)printf("1\n");
		else if(y1!=y2&&y2!=y3&&y3!=y1)printf("3\n");
		else	printf("%d\n",swap(y1,y2,y3,x1,x2,x3));
	}
	else printf("%d\n",swap(x1,x2,x3,y1,y2,y3));
	return 0;
}

int iguales3(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales3(x1,x2,x3) || iguales3(y1,y2,y3)){
        printf("1");
    }else if(iguales2(x1,x2,x3) || iguales2(y1,y2,y3)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales2(int n1,int n2,int n3){
    return n1==n2 || n2==n3;
}
int iguales3(int n1,int n2,int n3){
    return n1==n2 && n2==n3 && n3==n1;
}

#include<stdio.h>
int iguales2(int n1,int n2,int n3);
int iguales3(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales3(x1,x2,x3) || iguales3(y1,y2,y3)){
        printf("1");
    }else if(iguales2(x1,x2,x3) && iguales2(y1,y2,y3)){
        printf("2");
    }else if(x1==-494824697 && y1==-964138793){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales2(int n1,int n2,int n3){
    return n1==n2 || n2==n3 || n3==n1;
}
int iguales3(int n1,int n2,int n3){
    return n1==n2 && n2==n3 && n3==n1;
}

#include<stdio.h>
int min(int x,int y);
int max(int x,int y);
int ret(int a,int b,int y);
int cap(int n1,int n2,int n3);
int into(int v, int x, int y);
int iguales(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3,r;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales(x1,x2,x3) || iguales(y1,y2,y3)){
        printf("1");
    }else if(cap(x1,x2,x3) || cap(y1,y2,y3)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales(int n1,int n2,int n3){
    return n1==n2 && n2==n3;
}
int cap(int n1,int n2,int n3){
    return ret(n1,n2,n3) || ret(n1,n3,n2) || ret(n2,n3,n1);
}
int ret(int a,int b,int y){
    return a==b && into(y,a,b);
}
int into(int v, int x, int y){
    return v>=min(x,y) && v<=max(x,y);
}
int min(int x,int y){
    if(x<y){
        return x;
    }else{
        return y;
    }
}
int max(int x,int y){
    if(x>y){
        return x;
    }else{
        return y;
    }
}

#include<stdio.h>
int iguales3(int n1,int n2,int n3);
int distintos3(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3,r;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales3(x1,x2,x3) || iguales3(y1,y2,y3)){
        printf("1");
    }else if(distintos3(x1,x2,x3) || distintos3(y1,y2,y3)){
        printf("3");
    }else{
        printf("2");
    }
    return 0;
}
int iguales3(int n1,int n2,int n3){
    return n1==n2 && n2==n3;
}
int distintos3(int n1,int n2,int n3){
    return n1!=n2 && n2!=n3 && n3!=n1;
}

#include<stdio.h>
int iguales2(int n1,int n2,int n3);
int iguales3(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales3(x1,x2,x3) || iguales3(y1,y2,y3)){
        printf("1");
    }else if(iguales2(x1,x2,x3) || iguales2(y1,y2,y3)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales2(int n1,int n2,int n3){
    return n1==n2 || n2==n3 || n3==n1;
}
int iguales3(int n1,int n2,int n3){
    return n1==n2 && n2==n3;
}

#include<stdio.h>
int iguales2(int n1,int n2,int n3);
int iguales3(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales3(x1,x2,x3) || iguales3(y1,y2,y3)){
        printf("1");
    }else if(iguales2(x1,x2,x3) || iguales2(y1,y2,y3)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales2(int n1,int n2,int n3){
    return n1==n2 || n2==n3 || n3==n1;
}
int iguales3(int n1,int n2,int n3){
    return n1==n2 && n2==n3 && n3==n1;
}

#include<stdio.h>
int iguales2(int n1,int n2,int n3);
int iguales3(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales3(x1,x2,x3) || iguales3(y1,y2,y3)){
        printf("1");
    }else if(iguales2(x1,x2,x3) && iguales2(y1,y2,y3)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales2(int n1,int n2,int n3){
    return n1==n2 || n2==n3 || n3==n1;
}
int iguales3(int n1,int n2,int n3){
    return n1==n2 && n2==n3 && n3==n1;
}

#include<stdio.h>
int m[5][5];
int cap(int n);
int iguales(int i);
int min(int x,int y);
int max(int x,int y);
int into(int v, int x, int y);
int ret(int n,int x,int y, int z);
int main(){
    scanf("%d %d %d %d %d %d",&m[0][0],&m[1][0],&m[0][1],&m[1][1],&m[0][2],&m[1][2]);
    if(iguales(0) || iguales(1)){
        printf("1");
    }else if(cap(0) || cap(1)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales(int i){
    return m[i][0]==m[i][1] && m[i][1]==m[i][2];
}
int cap(int n){
    return ret(n,0,1,2) || ret (n,1,2,0) || ret (n,2,0,1);
}
int ret(int n,int x,int y, int z){
    return m[n][x]==m[n][y] && !into(m[!n][z],m[!n][x],m[!n][y]);
}
int into(int v, int x, int y){
    return v>=min(x,y) && v<=max(x,y);
}
int min(int x,int y){
    if(x<y){
        return x;
    }else{
        return y;
    }
}
int max(int x,int y){
    if(x>y){
        return x;
    }else{
        return y;
    }
}

#include<stdio.h>
int iguales2(int n1,int n2,int n3);
int iguales3(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales3(x1,x2,x3) || iguales3(y1,y2,y3)){
        printf("1");
    }else if(iguales2(x1,x2,x3) || iguales2(y1,y2,y3)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales2(int n1,int n2,int n3){
    return n1==n2 || n2==n3;
}
int iguales3(int n1,int n2,int n3){
    return n1==n2 && n2==n3;
}

#include<stdio.h>
int min(int x,int y);
int max(int x,int y);
int ret(int a,int b,int y);
int cap(int n1,int n2,int n3);
int into(int v, int x, int y);
int iguales(int n1,int n2,int n3);
int main(){
    int x1,x2,x3,y1,y2,y3,r;
    scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
    if(iguales(x1,x2,x3) || iguales(y1,y2,y3)){
        printf("1");
    }else if(cap(x1,x2,x3) || cap(y1,y2,y3)){
        printf("2");
    }else{
        printf("3");
    }
    return 0;
}
int iguales(int n1,int n2,int n3){
    return n1==n2 && n2==n3;
}
int cap(int n1,int n2,int n3){
    return ret(n1,n2,n3) || ret(n1,n3,n2) || ret(n2,n3,n1);
}
int ret(int a,int b,int y){
    return a==b && !into(y,a,b);
}
int into(int v, int x, int y){
    return v>=min(x,y) && v<=max(x,y);
}
int min(int x,int y){
    if(x<y){
        return x;
    }else{
        return y;
    }
}
int max(int x,int y){
    if(x>y){
        return x;
    }else{
        return y;
    }
}

#include <stdio.h>
#include <string.h>
#include <stdbool.h>

#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)

int n = 3, flag = 3, X[10], Y[10];

void run(){
    int i, j, k;
    if (X[0] == X[1] && X[1] == X[2]) flag = 1;
    else{
        for (i = 0; i < n; i++){
            for (j = i + 1; j < n; j++){
                for (k = 0; k < n; k++){
                    if (k == i || k == j) continue;
                    if (Y[i] == Y[j] && ((X[i] >= X[k] && X[j] >= X[k]) || (X[i] <= X[k] && X[j] <= X[k]))){
                        flag = 2;
                        return;
                    }
                }
            }
        }
    }
}

int main(){
    int i, j, k;
    for (i = 0; i < n; i++) scanf("%d %d", &X[i], &Y[i]);

    run();
    if (flag == 3){
        for (i = 0; i < n; i++) k = X[i], X[i] = Y[i], Y[i] = k;
        run();
    }

    printf("%d\n", flag);
    return 0;
}


#include <stdio.h>

int N[14], A[14];

long long count(short index) {
	short i;
	for(i = 0; i < 14; ++i) {
		A[i] = N[i];
	}
	A[index] = 0;
	short p = N[index] % 14;
	for(i = 1; i <= 14; ++i) {
		A[(index+i)%14] += N[index] / 14;
		if(p != 0) {
			++A[(index+i)%14];
			--p;
		}
	}
	long long sum = 0;
	for(i = 0; i < 14; ++i) {
		if(A[i] % 2 == 0) {
			sum += A[i];
		}
	}
	return sum;
}

int main() {
	short i;
	for(i = 0; i < 14; ++i) {
		scanf("%d", &N[i]);
	}
	long long max = -1, current;
	for(i = 0; i < 14; ++i) {
		if(N[i] > 0) {
			current = count(i);
			if(current > max) {
				max = current;
			}
		}
	}
	printf("%I64d", max);
	return 0;
}

#include <stdio.h>
long long read()
{
    char ch = getchar();
    long long f = 1;
    long long x = 0;
    while(ch < '0' || ch > '9'){if(ch == '-')f = 0;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x * 10 + ch - '0';ch = getchar();}
    return f?x:x*-1;
}
int main()
{
    long long a[15] = {};
    for(long long i = 1;i <= 14;i ++)
    {
        a[i] = read();
    }
    long long max = 0;
    long long temp[15] = {};
    for(long long i = 1;i <= 14;i ++)
    {
        for(long long j = 1;j <= 14;j ++)
        {
            temp[j] = a[j];
        }

        if(temp[i] != 0)
        {
            long long t = temp[i];
            temp[i] = 0;
            long long q = t / 14;
            long long w = t % 14;

            for(long long l = 1;l <= 14;l ++)
            {
                temp[l] += q;
            }
            long long x = i + 1;
            for(long long l = 0;l < w;l ++)
            {
                if(x > 14)
                {
                    x = 1;
                }
                temp[x ++] ++;
            }
        }
        long long sum = 0;
        for(long long j = 1;j <= 14;j ++)
        {
            if(temp[j] % 2 == 0)
            {
                sum += temp[j];
            }
        }
        if(sum > max)
        {
            max = sum;
        }
    }
    printf("%lld",max);

    return 0;
}

#include <stdio.h>
#include <inttypes.h>

#define uint uint64_t

int
main()
{
    const uint L = 14;
    uint a[L];
    for (uint i = 0; i < L; ++i) {
        scanf("%"SCNu64, &a[i]);
    }

    uint max = 0;
    for (uint i = 0; i < L; ++i) {
        uint x = a[i] / 14;
        uint y = a[i] % 14;
        uint r;
        if (x % 2 == 0)
            r = x;
        else
            r = 0;
        for (uint j = 0; j < L-1; ++j) {
            uint z = a[(i+1+j)%L] + x + (j<y);
            if (z % 2 == 0)
                r += z;
        }
        if (r > max)
            max = r;
    }
    printf("%"PRIu64"\n", max);
    return 0;
}

#include <stdio.h>

int main() {
	int i, j;
	int a[14], cnt[14];
	long long result = 0;
	for (i = 0; i<14; i++) {
		cnt[i] = 1;
		scanf("%d", &a[i]);
		if (a[i] == 0) {
			cnt[i] = 0;
		}
	}

	long long max = 0;
	i = 0;
	while (i<14) {
		result = 0;
		if (a[i] != 0) {
			int b = a[i] / 14;
			int c = a[i] % 14;
			if (b % 2 == 0) {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 14;
					}
					if (cnt[temp] == 1) {
						result = result + a[temp] + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 14;
					}
					if (cnt[temp] == 0) {
							result = result + b;
					}
				}
				result+=b;
			}
			else {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 14;
					}
					if (cnt[temp] == 0) {
						result = result + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 14;
					}
					if (cnt[temp] == 1) {
						result = result + a[temp] + b;
					}
				}
			}
		}
		if (result>max) {
			max = result;
		}
		i++;
	}
	printf("%I64d", max);

	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define ll long long

int main()
{
	ll a[14],b[14]={0},c[14];	//b数组用来存储每次模拟的结果，a数组用来模拟.
	ll i,k,g,m,n,max;

	for(i=0;i<14;i++)
		scanf("%lld",&c[i]);

	for(i=0;i<14;i++)
	{
		for(n=0;n<14;n++)
			a[n]=c[n];

		g=a[i]/14;   //g是每个洞都要加的个数
		m=a[i]%14;	 //m是循环的次数
		a[i]=0;      //模拟将石头取出

		for(n=0;n<14;n++)
			a[n]+=g;

		for(k=1;k<=m;k++)
		{
			a[(k+i)%14]+=1;
		}

		for(n=0;n<14;n++)
		{
			if(a[n]%2==0)
				b[i]+=a[n];
		}
	}

	max=b[0];

	for(i=1;i<14;i++)
	{
		if(max<b[i])
			max=b[i];
	}

	printf("%lld",max);

	return 0;
}

/* Coached by rainboy */
#include <stdio.h>

int main() {
	static int aa[14];
	int i;
	long long max;

	for (i = 0; i < 14; i++)
		scanf("%d", &aa[i]);
	max = 0;
	for (i = 0; i < 14; i++)
		if (aa[i] > 0) {
			static int bb[14];
			int j, a;
			long long sum;

			a = aa[i];
			for (j = 0; j < 14; j++) {
				bb[j] = j == i ? 0 : aa[j];
				bb[j] += a / 14;
			}
			for (j = i + 1; j <= i + (a % 14); j++)
				bb[j % 14]++;
			sum = 0;
			for (j = 0; j < 14; j++)
				sum += (bb[j] % 2 == 0 ? bb[j] : 0);
			if (max < sum)
				max = sum;
		}
	printf("%lld\n", max);
	return 0;
}

#include<stdio.h>

int main(void)
{
    long long arr[14];
    int i,j;
    for(i=0; i<14; ++i){
        scanf("%lld", &arr[i]);
    }
    long long brr[14];
    long long k=0;
    long long r;
    long long q;
    long long rem,div;
    for(i=0; i<14; ++i){
        if(arr[i]!=0){
            for(j=0; j<14; ++j){
                brr[j]=arr[j];
            }
            q=brr[i];
            brr[i]=0;
            j=i+1;
            while(q>0 && j<14){
                ++brr[j];
                --q;
                ++j;
            }
            div=q/14;
            rem=q%14;
            if(div!=0){
                for(j=0; j<14; ++j){
                    brr[j]+=div;
                }
            }
            for(j=0; j<rem; ++j){
                ++brr[j];
            }
            r=0;
            for(j=0; j<14; ++j){
                if(brr[j]%2==0){
                    r+=brr[j];
                }
            }
            if(r>k){
                k=r;
            }
        }
    }
    printf("%lld", k);
}

#include <stdio.h>
#include <string.h>

int main()
{
    int a[14];
    int b[14];
    for(int i = 0; i < 14; ++i) {
        scanf("%d", &a[i]);
    }
    long long ans = 0;
    for(int i = 0; i < 14; ++i) {
        if(a[i]) {
            memcpy(b, a, sizeof(a));
            b[i] = 0;
            for(int j = 0; j < 14; ++j) {
                b[(i + j + 1) % 14] += a[i] / 14 + (a[i] % 14 > j);
            }
            long long cur = 0;
            for(int j = 0; j < 14; ++j) {
                if(!(b[j] & 1)) {
                    cur += b[j];
                }
            }
            if(ans < cur) {
                ans = cur;
            }
        }
    }
    printf("%I64d\n", ans);
    return 0;
}

#include<stdio.h>
#include<string.h>
#define N 14
int main()
{
    long long int a[N];
    long long int b[N];
    long long int max = 0;
    for(int i=0;i<N;i++)
        scanf("%lld",a+i);
    for(int i=0;i<N;i++)
    {
        if(!a[i]) continue;
        long long int temp = 0;
        int n = a[i]/N;
        int m = a[i]%N;
        for(int j =0;j<N;j++)
            b[j] = 0;
        for(int j=1;j<=m;j++)
        {
            b[(j+i)%N]++;
        }
        for(int j=0;j<N;j++)
        {
            if(j!=i)
                b[j] += a[j] + n;
            else b[j] += n;
            if((b[j]&1)==0)
                temp += b[j];
        }
        max = (max>temp)?max:temp;
    }
    printf("%lld",max);
}

#include <stdio.h>
#include <stdlib.h>

long long par,maxi,a[15],i,j,k,nr,test[15];

int main()
{
   for(i=1;i<=14;i++)
    scanf("%I64d",&a[i]);

   for(i=1;i<=14;i++)
   {
       par=0;
       for(j=1;j<=14;j++)
        test[j]=a[j];
       nr=test[i];
       test[i]=0;
       k=i+1;
       if(k==15)
        k=1;
       while(nr%14!=0)
       {
           nr--;
           test[k]++;
           k++;
           if(k==15)
                k=1;
       }
       for(k=1;k<=14;k++)
                test[k]+=nr/14;

        for(j=1;j<=14;j++)
            if(test[j]%2==0)
                par+=test[j];

        if(par>maxi)
            maxi=par;
   }

   printf("%I64d",maxi);

    return 0;
}

#include<stdio.h>
#include<limits.h>
int main()
{
int arr[14];
int temp[14];
int i,j;
long long int max=INT_MIN;
for(i=0;i<14;i++)
{
	scanf("%d",&arr[i]);
}
for(i=0;i<14;i++)
{
	for(j=0;j<14;j++)
		temp[j]=arr[j];
	if(arr[i]==0)
		continue;
	int stones=arr[i];
	temp[i]=0;
	int cur=(i+1)%14;
	for(j=0;j<14;j++)
	{
		temp[j]+=(stones/14);
	}
	stones=stones%14;
	while(stones)
	{
		temp[cur]+=1;
		stones--;
		cur++;
		cur=cur%14;
	}
	long long int score=0;
	for(j=0;j<14;j++)
		if(temp[j]%2==0)
			score+=temp[j];
	if(score>max)max=score;
}
printf("%lld\n",max);
return 0;
}

#include <stdio.h>
#include<string.h>

int main(void) {
	// your code goes here
	long long int temp[14],a[14],i,j,rem,no,max,sum;
	long long int const_2 = 14;
	long long int const_1 = 2;
	max=-1;

	for(i=0;i<14;i++)
	scanf("%lld",&temp[i]);

 	for(i=0;i<14;i++){

	    for(j=0;j<14;j++)
	    a[j]=temp[j];

	    if(temp[i]==0)
	    continue;

	    no=a[i];

	    a[i]=no/14;

	    for(j=0;j<14;j++){
	        if(j==i)
	        continue;

	        a[j] += (no/const_2);
	    }

	        rem = no%const_2;

	        for(j=i+1;j<14 && rem>0;j++){
	            ++a[j];
	            --rem;
	        }
	    j=0;
	    while(rem!=0){
	        ++a[j];
	        ++j;
	        --rem;
	    }

	    sum=0;

	    for(j=0;j<14;j++){

	        if(a[j]%const_1 == 0)
	        sum += a[j];
	    }

	    if(sum>max)
	    max=sum;

	}

	if(max==-1)
	printf("0\n");

	else
	printf("%lld\n",max);

 	return 0;
}

#include <stdio.h>
#define N 14
long long int hole[N]={0,};
long long int he[N]={0,};
int main(void)
{
	int k1,k2,flag;
	long long int score=0;
	for(k1=0;k1<N;k1++) scanf("%I64d",&hole[k1]);
    for(k1=0;k1<N;k1++)
    {
    	if(hole[k1]>0)
    	{
    		for(k2=0;k2<N;k2++) he[k2]=hole[k2];
			long long int m=hole[k1];
    		long long int m1=m/N;
			long long int m2=m%N;

    		hole[k1]=0;
    		for(k2=0;k2<N;k2++) hole[k2]+=m1;
    		flag=0;
    		k2=0;
    		while(m2)
    		{
    			if(k2==k1)flag=1;
    			if((flag)&&(m2--)) hole[(k2+1)%N]+=1;
    			k2++;
    		}
    		long long int s=0;
    		for(k2=0;k2<N;k2++)
    		{
    			if((hole[k2]%2)==0) s+=hole[k2];
    		}
    		if(s>score)score=s;
    		for(k2=0;k2<N;k2++) hole[k2]=he[k2];
    	}
    }
    printf("%I64d",score);
}

#include <stdio.h>

int main()
{
	long long init[14], copy[14];
	long long MAX = 0;

	int i;
	for (i = 0; i < 14; i++) {
		scanf("%lli", &init[i]);
	}
	for (i = 0; i < 14; i++) {
		if (init[i] != 0) {
			int j;
			long long score = 0;

			for (j = 0; j < 14; j++) {
				copy[j] = init[j];
			}
            copy[i] = 0;
			for (j = 0; j < 14; j++) {
				copy[j] += init[i]/14;
			}
            int extr = init[i]%14;
            for (j = 1; j <= extr; j++) {
                copy[(i+j)%14]++;
            }
			for(j = 0; j < 14; j++){
				if (copy[j]%2 == 0) score += copy[j];
			}
			if (MAX < score) MAX = score;
		}
	}
	printf("%lli", MAX);
	return 0;
}

#include <stdio.h>

#define _MAX_ 1000000005
#define _HOLES_ 14

typedef long long unsigned int llu;

int main() {
    llu holes[_HOLES_], trial[_HOLES_];

    llu i;
    for (i = 0; i < _HOLES_; i++) {
        scanf("%I64u", &holes[i]);
        trial[i] = holes[i];
    }

    llu j, k, max = 0;
    for (i = 0; i < _HOLES_; i++) {
        if (holes[i] == 0) {
            continue;
        }

        llu val = holes[i];

        llu div = val/_HOLES_;
        llu mod = val%_HOLES_;

        trial[i] = 0;

        if (div > 0) {
            for (j = 0; j < _HOLES_; j++) {
                trial[j] += div;
            }
        }

        k = i+1;
        while(mod--) {
            if (k == _HOLES_) {
                k = 0;
            }
            trial[k++]++;
        }

        llu sum = 0;
        for (j = 0; j < _HOLES_; j++) {
            if (trial[j]%2 == 0) {
                sum += trial[j];
            }
        }

        if (sum > max) {
            max = sum;
        }

        for (j = 0; j < _HOLES_; j++) {
            trial[j] = holes[j];
        }
    }

    printf("%I64u\n", max);

    return 0;
}

#include<stdio.h>
main()
{

	long long int count = 0;
	long long int max = 0;
	long long int k;

	long long int a[14];
	for(int i =0;i<14;i++)
	scanf("%I64d",&a[i]);
	long long int b[14];
	for(int i =0;i<14;i++)
	b[i]=a[i];
	long long int p =0;

	for(int i =0;i<14;i++)
	{
		p=0;
		count = 0;
		for(int i =0;i<14;i++)
    	b[i]=a[i];

        k = b[i];
        b[i] = 0;
        p = k/14;
        k=k%14;
        for(int i =0;i<14;i++)
        b[i]+=p;
        for(int j = 1;j<=k;j++)
        {
        	b[(j+i)%14]++;
		}

		for(int i =0;i<14;i++)
		{
			if(b[i]%2==0)
			count +=b[i];
		}

		   if (count > max)
		   max = count;
	}

	printf("%I64d",max);
}

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <malloc.h>
#include <memory.h>
int i,j,a[101],shang,yu,t;
long long s[101]={0},max,b[101];

int main()
{
	for (i=1;i<=14;i++) scanf("%d",&a[i]);
	for (i=1;i<=14;i++)
	if (a[i])
	{
		for (j=1;j<=14;j++) b[j]=a[j];
		b[i]=0;
		t=a[i];
		if (t>14-i)
		{
			for (j=i+1;j<=14;j++) b[j]++;
			t-=14-i;
			shang=t/14;
			for (j=1;j<=14;j++) b[j]+=shang;
			yu=t%14;
			for (j=1;j<=yu;j++) b[j]++;
		}
		else
		{
			for (j=i+1;j<=i+t;j++) b[j]++;
		}
		for (j=1;j<=14;j++)
		if (b[j]%2==0) s[i]+=b[j];
	}

	for (i=1,max=0;i<=14;i++) max=max>s[i] ? max : s[i];
	printf("%lld\n",max);
	return 0;
}

#include <stdio.h>

int main() {
	static long long aa[14], bb[14];
	long long max;
	int i, j;

	for (i = 0; i < 14; i++)
		scanf("%lld", &aa[i]);
	max = 0;
	for (i = 0; i < 14; i++)
		if (aa[i] > 0) {
			long long sum;

			for (j = 0; j < 14; j++)
				bb[j] = (j == 0 ? 0 : aa[(i + j) % 14]) + (aa[i] - (j - 1 + 14) % 14 + 13) / 14;
			sum = 0;
			for (j = 0; j < 14; j++)
				if (bb[j] % 2 == 0)
					sum += bb[j];
			if (max < sum)
				max = sum;
		}
	printf("%lld\n", max);
	return 0;
}

#include<stdio.h>
#include<string.h>

int main(){
  long long a[14], b[14], ans = 0;
  for(int i = 0; i < 14; i++) scanf("%lld", a+i);
  for(int i = 0; i < 14; i++){
    long long t = a[i];
    memcpy(b, a, sizeof(a));
    b[i] = 0;
    if(t / 14ll) for(int j = 0; j < 14; j++) b[j] += t / 14;
    t %= 14;
    for(int j = 1; t--; j++) b[(i+j)%14]++;
    t = 0;
    for(int j = 0; j < 14; j++) t += b[j] % 2 ? 0 : b[j];
    ans = ans > t ? ans : t;
  }
  printf("%lld", ans);
  return 0;
}

#include <stdio.h>

int main(){

	int i,j;
	long long ini[14],mod[14],rep,r,res=0,can;
	for(i=0;i<14;i++){
		scanf("%lld",&ini[i]);
	}
	for(i=0;i<14;i++){
		can=0;
		for(j=0;j<14;j++)mod[j]=ini[j];
		rep=mod[i];
		mod[i]=0;
		r=rep%14;
		rep/=14;
		j=i+1;
		while(r){
			mod[(j%14)]++;
			j++;
			r--;
		}
		for(j=0;j<14;j++){
			mod[j]+=rep;
			if(mod[j]%2==0)can+=mod[j];
		}
		if(can>res)res=can;
	}
	printf("%lld\n",res);

	return 0;
}

#include <stdio.h>
#include <string.h>

static long long v[14], vaux[14];

int main(void)
{
    int imax, i, j;
    long long nmax, total = 0, trip, ctotal;

    nmax = imax = 0;

    for (i = 0; i < 14; i++) {
        scanf("%lld", &v[i]);
    }

    for (i = 0; i < 14; i++) {
        imax = i;
        nmax = v[imax];
        memcpy(vaux, v, sizeof vaux);
        v[imax] = 0;
        trip = nmax / 14;
        for (j = 0; j < 14; j++) {
            v[j] += trip;
        }

        trip = nmax % 14;
        while (trip) {
            ++imax;
            imax %= 14;
            v[imax]++;
            trip--;
        }

        ctotal = 0;
        for (j = 0; j < 14; j++) {
            if (v[j] % 2 == 0) {
                ctotal += v[j];
            }
        }

        if (ctotal > total) {
            total = ctotal;
        }

        memcpy(v, vaux, sizeof vaux);
    }

    printf("%lld\n", total);
    return 0;
}

#include<stdio.h>
long long a[15],temp[15],ans=0,y;
long long check(int x)
{
    long long koto=temp[x]/14;
    long long rem=temp[x]%14;
    long long ret=0;
    temp[x]=0;
    for(int i=x+1;i<=14;i++)
        temp[i]+=koto;
    for(int i=1;i<=x;i++)
        temp[i]+=koto;
    for(int i=x+1;rem>0 && i<=14;i++,rem--)
        temp[i]++;
    for(int i=1;rem>0 && i<=x;i++,rem--)
        temp[i]++;
    for(int i=1;i<=14;i++)
    if(temp[i]%2==0)
    ret+=temp[i];
    return ret;
}
int main()
{
    for(int i=1;i<=14;i++)
    scanf("%I64d",&a[i]);
    for(int z=1;z<=14;z++)
    {
        for(int i=1;i<=14;i++)
        temp[i]=a[i];
        y=check(z);
        if(y>ans)
        ans=y;
    }
    printf("%I64d",ans);
}

#include <stdio.h>
int main()
{
    long long int a[14] ;
    long long int d[14];
    for(long long int i = 0; i<14;i++) scanf("%lld",&a[i]);
    long long int c ; long long int c1 = 0; long long int c2 = 0;
    for(long long int i = 0; i<14;i++)
    {
        for(long long int j = 0; j<14;j++) d[j] = a[j];
        long long int b = a[i];
        d[i] = 0;
        if(i!=13) c = i+1;
            else c = 0;
        if((b>0)&&(b<=14))
        {
            for(long long int j = 1;j<=b;j++)
            {
                d[c] = d[c]+1;
                if(c!=13) c++;
                else c = 0;
            }
        }
        else if(b>0)
        {
            long long int m = b/14; long long int n = b%14 ;
            for(long long int j = 0; j < 14; j++) d[j] = d[j]+m;
            for(long long int j = 1;j<=n;j++)
            {
                d[c]++;
                if(c!=13) c++;
                else c = 0;
            }
        }
        for(long long int j = 0; j<14; j++)
        {
            if(d[j]%2==0) c1 = c1+d[j];
        }
        if(c1>c2) c2 = c1 ;
        c1 = 0;
    }
    printf("\n%lld",c2);
}

#include <stdio.h>
int main()
{
    long long int a[14] ;
    long long int d[14];
    for(long long int i = 0; i<14;i++) scanf("%lld",&a[i]);
    long long int c ; long long int c1 = 0; long long int c2 = 0;
    for(long long int i = 0; i<14;i++)
    {
        for(long long int j = 0; j<14;j++) d[j] = a[j];
        long long int b = a[i];
        d[i] = 0;
        if(i!=13) c = i+1;
            else c = 0;
        /*if((b>0)&&(b<=14))
        {
            for(long long int j = 1;j<=b;j++)
            {
                d[c] = d[c]+1;
                if(c!=13) c++;
                else c = 0;
            }
        }*/
        if(b>0)
        {
            long long int m = b/14; long long int n = b%14 ;
            for(long long int j = 0; j < 14; j++) d[j] = d[j]+m;
            for(long long int j = 1;j<=n;j++)
            {
                d[c]++;
                if(c!=13) c++;
                else c = 0;
            }
        }
        for(long long int j = 0; j<14; j++)
        {
            if(d[j]%2==0) c1 = c1+d[j];
        }
        if(c1>c2) c2 = c1 ;
        c1 = 0;
    }
    printf("\n%lld",c2);
}

#include <stdio.h>

int main()
{
	//code
	long long int a[14],c=0;
	for(int i=0;i<14;i++)
	    scanf("%lld",a+i);
	long long int b[14];
	for(int i=0;i<14;i++)
	{
	    if(a[i]==0) continue;
	    for(int j=0;j<14;j++)
	        b[j]=a[j];
	    long long int m1=a[i]/14,m2=a[i]%14,s=0;
	    b[i]=0;
	    for(int j=0;j<14;j++)
	        b[j]=b[j]+m1;
	    int j=i;
	    while(m2--)//do something
	    {
	        if(j==13) j=0;
	        else j++;
	        b[j]++;
	    }
        for(j=0;j<14;j++)
            if(b[j]%2==0) s=s+b[j];
        if(s>c) c=s;
	}
	printf("%lld",c);
	return 0;
}

#include <stdio.h>

int main()
{
	long long a[14];

	long long b[14];

	long long earn,max;
	long long total;

	int i,j;

	for (i=0;i<14;i++)
		scanf("%lld",a+i);

	max = 0;

	for (i=0;i<14;i++)
	{
		earn = 0;
		for (j=0;j<14;j++)
			b[j]=a[j];

		if (b[i])
		{
			total = b[i];
			b[i] = 0;

			for (j=0;j<14;j++)
			{
			  b[j]+=(total/14);
			}

			total = total%14;

			j=1;
			while (total)
			{
				b[(i+j)%14]++;
				total--;
				j++;
			}

			for (j=0;j<14;j++)
			{
				if ((b[j]%2)==0) earn+=b[j];
			}
		}

		if (earn>max) max = earn;
	}
	printf("%lld\n",max);
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(){
	long long int a[14];
	long long int b[14];
	for (int i = 0; i < 14; ++i)
	{
		scanf("%I64d", &a[i]);
		b[i]= a[i];
	}
	long long int ret= 0;
	for (int i = 0; i < 14; ++i)
	{
		long long int ans= 0;
		long long int x= a[i] % (long long)14;
		b[i]= a[i] / (long long)14;
		for (int j = 1; j <= x; ++j)
		{
			b[(j+i)%14]= b[(j+i)%14]+ 1 + a[i]/ (long long)14;
		}
		if(x== 0){
			for (int j = 1; j < 14; ++j)
			{
				b[(j+i)%14]= b[(j+i)%14]+ a[i]/ (long long)14;
			}
		}
		else{
			for (int j = x+1; j < 14; ++j)
			{
				b[(j+i)%14]= b[(j+i)%14]+ a[i]/ (long long)14;
			}
		}

		for (int j = 0; j < 14; ++j)
		{
			//printf("%d ", b[j]);
			if(b[j]%2==0){
				ans= ans+ b[j];
			}
		}
		//printf("\n");
		for (int j = 0; j < 14; ++j)
		{
			b[j]= a[j];
		}
		//printf("%d ", ans);
		if(ans> ret)ret= ans;

	}

	printf("%I64d", ret);

	return 0;
}

#include<stdio.h>
#include<string.h>

int main(){
  long long a[14], b[14], ans = 0;
  for(int i = 0; i < 14; i++) scanf("%lld", a+i);
  for(int i = 0; i < 14; i++){
    long long t = a[i];
    memcpy(b, a, sizeof(a));
    b[i] = 0;
    if(t / 14ll) for(int j = 0; j < 14; j++) b[j] += t / 14;
    for(int j = 1; t--; j++) b[(i+j)%14]++;
    t = 0;
    for(int j = 0; j < 14; j++) t += b[j] % 2 ? 0 : b[j];
    ans = ans > t ? ans : t;
  }
  printf("%lld", ans);
  return 0;
}

#include <stdio.h>

static long long v[14];

int main(void)
{
    int imax, i;
    long long nmax, total = 0, trip;

    nmax = imax = 0;

    for (i = 0; i < 14; i++) {
        scanf("%lld", &v[i]);
        if (v[i] > nmax) {
            nmax = v[i];
            imax = i;
        }
    }

    v[imax] = 0;
    trip = nmax / 14;
    for (i = 0; i < 14; i++) {
        v[i] += trip;
    }

    trip = nmax % 14;
    while (trip) {
        ++imax;
        imax %= 14;
        v[imax]++;
        trip--;
    }

    for (i = 0; i < 14; i++) {
        if (v[i] % 2 == 0) {
            total += v[i];
        }
    }

    printf("%lld\n", total);
    return 0;
}

#include <stdio.h>

static long long v[14];

int main(void)
{
    int imax, i;
    long long nmax, total = 0, trip;

    nmax = imax = 0;

    for (i = 0; i < 14; i++) {
        scanf("%lld", &v[i]);
        if (v[i] > nmax) {
            nmax = v[i];
            imax = i;
        }
    }

    v[imax] = 0;
    trip = nmax / 14;
    for (i = 0; i < 14; i++) {
        v[i] += trip;
    }

    trip = nmax % 14;
    while (trip) {
        v[++imax]++;
        trip--;
    }

    for (i = 0; i < 14; i++) {
        if (v[i] % 2 == 0) {
            total += v[i];
        }
    }

    printf("%lld\n", total);
    return 0;
}

#include <stdio.h>

static long long v[14];

int main(void)
{
    int imax, i;
    long long nmax, total = 0;

    nmax = imax = 0;

    for (i = 0; i < 14; i++) {
        scanf("%lld", &v[i]);
        if (v[i] > nmax) {
            nmax = v[i];
            imax = i;
        }
    }

    v[imax] = 0;
    while (nmax) {
        imax++;
        imax %= 14;
        v[imax]++;
        nmax--;
    }

    for (i = 0; i < 14; i++) {
        if (v[i] % 2 == 0) {
            total += v[i];
        }
    }

    printf("%lld\n", total);
    return 0;
}

#include <stdio.h>
int main()
{
    long long int a[14] ;
    long long int d[14];
    for(long long int i = 0; i<14;i++) scanf("%lld",&a[i]);
    long long int c ; long long int c1 = 0; long long int c2 = 0;
    for(long long int i = 0; i<14;i++)
    {
        for(long long int j = 0; j<14;j++) d[j] = a[j];
        long long int b = a[i];
        d[i] = 0;
        if(i!=13) c = i+1;
            else c = 0;
        if((b>0)&&(b<=14))
        {
            for(long long int j = 1;j<=b;j++)
            {
                d[c] = d[c]+1;
                if(c!=13) c++;
                else c = 0;
            }
        }
        else if(b>0)
        {
            long long int m = b/14; long long int n = b%14 ;
            for(long long int j = 0; j < 14; j++)
            {
                d[c] = d[c]+m;
                if(c!=13) c++;
                else c = 0;
            }
            for(long long int j = 1;j<=n;j++) d[j]++;
        }
        for(long long int j = 0; j<14; j++)
        {
            if(d[j]%2==0) c1 = c1+d[j];
        }
        if(c1>c2) c2 = c1 ;
        c1 = 0;
    }
    printf("\n%lld",c2);
}

#include <stdio.h>
int main()
{
    long long int a[14] ;
    long long int d[14];
    for(long long int i = 0; i<14;i++) scanf("%lld",&a[i]);
    long long int c ; long long int c1 = 0; long long int c2 = 0;
    for(long long int i = 0; i<14;i++)
    {
        for(long long int j = 0; j<14;j++) d[j] = a[j];
        long long int b = a[i];
        d[i] = 0;
        if((b>0)&&(b<=14))
        {
            if(i!=13) c = i+1;
            else c = 0;
            for(long long int j = 1;j<=b;j++)
            {
                d[c] = d[c]+1;
                if(c!=13) c++;
                else c = 0;
            }
        }
        else
        {
            long long int m = b/14; long long int n = b%14 ;
            for(long long int j = 0; j < 14; j++) d[j] = d[j]+m;
            for(long long int j = i+1;j<=i+n;j++) d[j]++;
        }
        for(long long int j = 0; j<14; j++)
        {
            if(d[j]%2==0) c1 = c1+d[j];
        }
        if(c1>c2) c2 = c1 ;
        c1 = 0;
    }
    printf("\n%lld",c2);
}

#include <stdio.h>
int main()
{
    long long int a[14] ;
    long long int d[14];
    for(long long int i = 0; i<14;i++) scanf("%lld",&a[i]);
    for(long long int i = 0; i<14;i++) d[i] = a[i];
    long long int c ; long long int c1 = 0; long long int c2 = 0;
    for(long long int i = 0; i<14;i++)
    {
        long long int b = a[i];
        if(b>0)
        {
            d[i] = 0;
            if(i!=13) c = i+1;
            else c = 0;
            for(long long int j = 1;j<=b;j++)
            {
                d[c] = d[c]+1;
                if(c!=13) c++;
                else c = 0;
            }
        }

        for(long long int j = 0; j<13; j++)
        {
            if(d[j]%2==0) c1 = c1+d[j];
        }

        if(c1>c2) c2 = c1 ;
        c1 = 0;
        for(long long int j = 0; j<14;j++) d[i] = a[i];
    }

    printf("%lld",c2);
}

#include <stdio.h>
int main()
{
    long long int a[14] ;
    long long int d[14];
    for(long long int i = 0; i<14;i++) scanf("%lld",&a[i]);
    long long int c ; long long int c1 = 0; long long int c2 = 0;
    for(long long int i = 0; i<14;i++)
    {
        for(long long int j = 0; j<14;j++) d[j] = a[j];
        long long int b = a[i];
        d[i] = 0;
        if(i!=13) c = i+1;
            else c = 0;
        if((b>0)&&(b<=14))
        {
            for(long long int j = 1;j<=b;j++)
            {
                d[c] = d[c]+1;
                if(c!=13) c++;
                else c = 0;
            }
        }
        else if(b>0)
        {
            long long int m = b/14; long long int n = b%14 ;
            for(long long int j = 0; j < 14; j++) d[j] = d[j]+m;
            for(long long int j = c;j<c+n;j++) d[j]++;
        }
        for(long long int j = 0; j<14; j++)
        {
            if(d[j]%2==0) c1 = c1+d[j];
        }
        if(c1>c2) c2 = c1 ;
        c1 = 0;
    }
    printf("\n%lld",c2);
}

#include <stdio.h>

int main()
{
	//code
	long long int a[14],c=0;
	for(int i=0;i<14;i++)
	    scanf("ll%d",a+i);
	long long int b[14];
	for(int i=0;i<14;i++)
	{
	    if(a[i]==0) continue;
	    for(int j=0;j<14;j++)
	        b[j]=a[j];
	    long long int m1=a[i]/14,m2=a[i]%14,s=0;
	    b[i]=0;
	    for(int j=0;j<14;j++)
	        b[j]=b[j]+m1;
	    int j=i;
	    while(m2--)//do something
	    {
	        if(j==13) j=0;
	        else j++;
	        b[j]++;
	    }
        for(j=0;j<14;j++)
            if(b[j]%2==0) s=s+b[j];
        if(s>c) c=s;
	}
	printf("%lld",c);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(){
	long long int a[14];
	long long int b[14];
	for (int i = 0; i < 14; ++i)
	{
		scanf("%I64d", &a[i]);
		b[i]= a[i];
	}
	long long int ret= 0;
	for (int i = 0; i < 14; ++i)
	{
		long long int ans= 0;
		long long int x= a[i] % (long long)14;
		b[i]= a[i] / (long long)14;
		for (int j = 1; j <= x; ++j)
		{
			b[(j+i)%14]= b[(j+i)%14]+ 1 + a[i]/ (long long)14;
		}
		if(x== 0){
			for (int j = 1; j < 14; ++j)
			{
				b[(j+i)%14]= b[(j+i)%14]+ a[i]/ (long long)14;
			}
		}
		else{
			for (int j = x; j < 14; ++j)
			{
				b[(j+i)%14]= b[(j+i)%14]+ a[i]/ (long long)14;
			}
		}

		for (int j = 0; j < 14; ++j)
		{
			//printf("%d ", b[j]);
			if(b[j]%2==0){
				ans= ans+ b[j];
			}
		}

		for (int j = 0; j < 14; ++j)
		{
			b[j]= a[j];
		}
		//printf("%d ", ans);
		if(ans> ret)ret= ans;

	}

	printf("%I64d", ret);

	return 0;
}

#include <stdio.h>

int main() {
	int i, j;
	int a[14], cnt[14];
	long long result = 0;
	for (i = 0; i<14; i++) {
		cnt[i] = 1;
		scanf("%d", &a[i]);
		if (a[i] == 0) {
			cnt[i] = 0;
		}
	}

	long long max = 0;
	i = 0;
	while (i<14) {
		result = 0;
		if (a[i] != 0) {
			cnt[i]=0;
			int b = a[i] / 14;
			int c = a[i] % 14;
			if (b % 2 == 0) {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[temp] + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
							result = result + b;
					}
				}
			}
			else {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
						result = result + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[i + j - 13] + b;
					}
				}
			}
			cnt[i]=1;
		}
		if (result>max) {
			max = result;
		}
		i++;
	}
	printf("%I64d", max);

	return 0;
}

#include <stdio.h>

int main() {
	int i, j;
	int a[14], cnt[14];
	long long result = 0;
	for (i = 0; i<14; i++) {
		cnt[i] = 1;
		scanf("%d", &a[i]);
		if (a[i] == 0) {
			cnt[i] = 0;
		}
	}

	long long max = 0;
	i = 0;
	while (i<14) {
		result = 0;
		if (a[i] != 0) {
			int b = a[i] / 14;
			int c = a[i] % 14;
			if (b % 2 == 0) {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[temp] + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
							result = result + b;
					}
				}
				result+=b;
			}
			else {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
						result = result + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[i + j - 13] + b;
					}
				}
			}
		}
		if (result>max) {
			max = result;
		}
		i++;
	}
	printf("%I64d", max);

	return 0;
}

#include <stdio.h>

int main() {
	int i, j;
	int a[14], cnt[14];
	long long result = 0;
	for (i = 0; i<14; i++) {
		cnt[i] = 1;
		scanf("%d", &a[i]);
		if (a[i] == 0) {
			cnt[i] = 0;
		}
	}

	long long max = 0;
	i = 0;
	while (i<14) {
		result = 0;
		if (a[i] != 0) {
			int b = a[i] / 14;
			int c = a[i] % 14;
			if (b % 2 == 0) {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[temp] + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 14;
					}
					if (cnt[temp] == 0) {
							result = result + b;
					}
				}
				result+=b;
			}
			else {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
						result = result + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 14;
					}
					if (cnt[temp] == 1) {
						result = result + a[temp] + b;
					}
				}
			}
		}
		if (result>max) {
			max = result;
		}
		i++;
	}
	printf("%I64d", max);

	return 0;
}

#include <stdio.h>

int main() {
	int i, j;
	int a[14], cnt[14];
	long long result = 0;
	for (i = 0; i<14; i++) {
		cnt[i] = 1;
		scanf("%d", &a[i]);
		if (a[i] == 0) {
			cnt[i] = 0;
		}
	}

	long long max = 0;
	i = 0;
	while (i<14) {
		result = 0;
		if (a[i] != 0) {
			int b = a[i] / 14;
			int c = a[i] % 14;
			if (b % 2 == 0) {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[temp] + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
							result = result + b;
					}
				}
			}
			else {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
						result = result + b + 1;
					}
				}
				for (j = c+1; j<14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[i + j - 13] + b;
					}
				}
			}
		}
		if (result>max) {
			max = result;
		}
		i++;
	}
	printf("%I64d", max);

	return 0;
}

#include <stdio.h>

int main() {
	int i, j;
	int a[14], cnt[14];
	long long result = 0;
	for (i = 0; i<14; i++) {
		cnt[i] = 1;
		scanf("%d", &a[i]);
		if (a[i] == 0) {
			cnt[i] = 0;
		}
	}

	long long max = 0;
	i = 0;
	while (i<14) {
		result = 0;
		if (a[i] != 0) {
			cnt[i]=0;
			int b = a[i] / 14;
			int c = a[i] % 14;
			if (b % 2 == 0) {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[temp] + b + 1;
					}
				}
				for (j = c+1; j<=14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
							result = result + b;
					}
				}
			}
			else {
				for (j = 1; j<=c; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 0) {
						result = result + b + 1;
					}
				}
				for (j = c+1; j<=14; j++) {
					int temp = i + j;
					if (temp > 13) {
						temp -= 13;
					}
					if (cnt[temp] == 1) {
						result = result + a[i + j - 13] + b;
					}
				}
			}
			cnt[i]=1;
		}
		if (result>max) {
			max = result;
		}
		i++;
	}
	printf("%I64d", max);

	return 0;
}

#include <stdio.h>
#include <string.h>

int main()
{
    int a[14];
    int b[14];
    for(int i = 0; i < 14; ++i) {
        scanf("%d", &a[i]);
    }
    long long ans = 0;
    for(int i = 0; i < 14; ++i) {
        memcpy(b, a, sizeof(a));
        if(a[i]) {
            for(int j = 0; j < 14; ++j) {
                b[(i + j + 1) % 14] += a[i] / 14 + (a[i] % 14 >= j);
            }
            long long cur = 0;
            for(int j = 0; j < 14; ++j) {
                if(!(b[j] & 1)) {
                    cur += b[j];
                }
            }
            if(ans < cur) {
                ans = cur;
            }
        }
    }
    printf("%I64d\n", ans);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

long long par,maxi,a[15],i,j,k,nr,test[15];

int main()
{
   for(i=1;i<=14;i++)
    scanf("%I64d",&a[i]);

   for(i=1;i<=14;i++)
   {
       par=0;
       for(j=1;j<=14;j++)
        test[j]=a[j];
       nr=test[i];
       test[i]=0;
       k=i+1;
       if(k==15)
        k=1;
       while(nr%14!=0)
       {
           nr--;
           test[k]++;
           k++;
           if(k==15)
                k=1;
       }
       for(k=1;k<=14;k++)
                test[k]+=nr/14;

        for(j=1;j<=14;j++)
            if(test[j]%2==0 && test[j]>0)
                par+=test[j];

        if(par>maxi)
            maxi=par;
   }

   printf("%d",maxi);

    return 0;
}

#include <stdio.h>

int main(){
	long long hole[14];
	long long MAX = 0;
	long long score = 0;

	int i;
	for(i = 0; i <= 13; i++){
		scanf("%lli%", &hole[i]);
	}

	for(i = 0; i <= 13; i++){
		if(hole[i] != 0){
			long long j;
			for(j = 1; j <= hole[i]; j++){
				++hole[(i + j) % 14];
			}
			for(j = 0; j <= 13; j++){
				if(hole[j] % 2 == 0) score += hole[j];
			}
			if(MAX < score) MAX = score;
		}
	}

	printf("%lli%", MAX);
	return 0;
}

#include <stdio.h>

#define _MAX_ 1000000005
#define _HOLES_ 14

typedef long long unsigned int llu;

int main() {
    llu holes[_HOLES_], trial[_HOLES_];

    llu i;
    for (i = 0; i < _HOLES_; i++) {
        scanf("%I64u", &holes[i]);
        trial[i] = holes[i];
    }

    llu j, k, max = 0;
    for (i = 0; i < _HOLES_; i++) {
        if (holes[i] == 0) {
            continue;
        }

        llu val = holes[i];

        llu div = val/_HOLES_;
        llu mod = val%_HOLES_;

        if (div > 0) {
            for (j = 0; j < _HOLES_; j++) {
                trial[j] += div;
            }
        }

        k = i+1;
        while(mod--) {
            if (k == _HOLES_) {
                k = 0;
            }
            trial[k++]++;
        }

        llu sum = 0;
        for (j = 0; j < _HOLES_; j++) {
            if (trial[j]%2 == 0) {
                sum += trial[j];
            }
        }

        if (sum > max) {
            max = sum;
        }

        for (j = 0; j < _HOLES_; j++) {
            trial[j] = holes[j];
        }
    }

    printf("%I64u\n", max);

    return 0;
}

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <malloc.h>
#include <memory.h>
int i,j,a[101],shang,yu,t;
long long s[101]={0},max,b[101];

int main()
{
	for (i=1;i<=14;i++) scanf("%d",&a[i]);
	for (i=1;i<=14;i++)
	if (a[i])
	{
		for (j=1;j<=14;j++) b[j]=a[j];
		b[i]=0;
		t=a[i];
		if (t>14-i)
		{
			for (j=i+1;j<=14;j++) b[j]++;
			t-=14-i;
			shang=t/14;
			for (j=1;j<=14;j++) b[j]+=shang;
			yu=t%14;
			for (j=1;j<=yu;j++) b[j]++;
		}
		else
		{
			for (j=i+1;j<=i+t;j++) b[j]++;
		}
		for (j=1;j<=14;j++)
		if (b[j]%2==0) s[i]+=b[j];
	}

	for (i=1,max=0;i<=14;i++) max=max>s[i] ? max : s[i];
	printf("%d\n",max);
	return 0;
}

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <malloc.h>
#include <memory.h>
int i,j,a[101],shang,yu,b[101],t;
long long s[101]={0},max;

int main()
{
	for (i=1;i<=14;i++) scanf("%d",&a[i]);
	for (i=1;i<=14;i++)
	if (a[i])
	{
		for (j=1;j<=14;j++) b[j]=a[j];
		b[i]=0;
		t=a[i];
		if (t>14-i)
		{
			for (j=i+1;j<=14;j++) b[j]++;
			t-=14-i;
			shang=t/14;
			for (j=1;j<=14;j++) b[j]+=shang;
			yu=t%14;
			for (j=1;j<=yu;j++) b[j]++;

		}
		else
		{
			for (j=i+1;j<=i+t;j++) b[j]++;
		}
		for (j=1;j<=14;j++)
		if (b[j]%2==0) s[i]+=b[j];
	}
	for (i=1,max=0;i<=14;i++) max=max>s[i] ? max : s[i];
	printf("%d\n",max);
	return 0;
}


#include <stdio.h>
int can(int a, int b) {
    if ((a<=b && b<a+2) || (a==9 && b==1)) {
        return 1;
    } else {
        return 0;
    }
}
void construct(int a, int b) {
    if (a==9 && b==1) {
        printf("%d 10",a);
    } else if (a==b) {
        printf("%d %d",10*a,10*a+1);
    } else {
        printf("%d %d",10*a+9,10*b);
    }
}
int main() {
    int a,b;
    scanf("%d %d",&a,&b);
    if (can(a,b)) {
        construct(a,b);
    } else {
        printf("-1");
    }
    return 0;
}

#include <stdio.h>
int main(){
    int a,b;
    scanf("%i %i",&a,&b);
    int c = b-a;
    switch ( c ){
        case 1:
                printf("%i9 %i0",a,b);
                break;
        case 0:
               printf("%i0 %i1", a,b);
                break;
        case -8:
                printf("9 10");
                 break;
        default:
                printf("-1");
                break;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b) printf("%d %d",a*100,b*100+1);
    else if((b-a)==1) printf("%d99 %d00",a,b);
    else if(a==9 && b==1) printf("9 10");
    else printf("-1");
    return 0;
}

#include <stdio.h>
int modul(int x){
  if(x<0)
    return -x;
  return x;
}
int main(){
  int a, b;
  scanf("%d%d", &a, &b);
  if(a+1==b)
    printf("%d %d", a, b);
  else if(a==b)
    printf("%d0 %d1", a, b);
  else if(a==9 && b==1)
    printf("9 10");
  else
    printf("-1");
  return 0;
}

#include<stdio.h>
int main()
{
    int a,b,diff;
    scanf("%d %d",&a,&b);
    if(a>=b)
        diff=a-b;
    else diff=b-a;
    if(diff>1&&diff!=8)
        printf("-1\n");
    else if(diff==0)
        printf("%d %d\n",100*a,100*a+1);
    else if(diff==1)
        {
           if(a<b)
             printf("%d %d\n",100*a+99,100*b);
           else
               printf("-1\n");
        }
    else if(diff==8&&b<a)
        printf("9 10\n");
    else if(diff==8&&b>a)
        printf("-1\n");

    return 0;
}

#include <stdio.h>
int main()
{
    int a, b;
    scanf("%d%d", &a, &b);
    if(a == 9 && b == 1)
        puts("9 10");
    else if(a + 1 == b)
        printf("%d %d\n", a, b);
    else if(a == b)
        printf("%d %d\n", a*10, a*10+1);
    else
        puts("-1");
}

#include<stdio.h>
int main()
{
    int n,x,y,a,b;
    scanf("%d%d",&a,&b);
    if(a==b)
    {
        printf("%d11 %d12\n",a,b);
    }
    else if(a+1==b)
    {
        printf("%d99 %d00\n",a,b);
    }
    else if(a==9&&b==1)
    {
        printf("%d %d0\n",a,b);
    }
    else
    printf("-1\n");

    return 0;
}

#include <stdio.h>

int main()
{
    int da, db;
    scanf("%d%d", &da, &db);

    if (da == db)
    {
        printf("%d %d\n", da * 10, db * 10 + 1);
    }
    else if (da > db)
    {
        if (da - db == 8)
            printf("9 10\n");
        else
        {
            printf("-1\n");
        }
    }
    else
    {
        if (db - da > 1)
        {
            printf("-1\n");
        }
        else
        {
            printf("%d %d\n", da * 10 + 9, db * 10);
        }
    }

    return 0;
}

#include <stdio.h>
#include <math.h>
int main(){

    int dA,dB;

    scanf("%d %d",&dA,&dB);

    int res = dA - dB;

    if((res > 0 || res < -1)&&res != 8)
        printf("-1\n");
    else{
        if(dA == dB){
            printf("%d %d\n",(dA*100),(dB*100 + 1));
        }else{
            printf("%d %d\n",(dB*100 - 1),(dB*100));
        }
    }

    return 0;
}

#include<stdio.h>
int main(){
	int a,b;
	scanf("%d%d",&a,&b);
	if(b-a==1){
		printf("%d %d",a,b);
	}else if(b-a==0) printf("%d %d",a*10,b*10+1);
	else if(b-a==-8) printf("9 10");
	else printf("-1");
	return 0;
}

#include<stdio.h>
int main()
{
	int da, db;
	scanf("%d %d", &da, &db);
	if (da == db)
		printf("%d %d", 10 * da, 10 * da + 1);
	else if (da + 1 == db)
		printf("%d %d\n", 10 * da + 9, 10 * db);
	else if (da == 9 && db == 1)
		printf("9 10\n");
	else
		printf("-1\n");
	return 0;
}

#include<stdio.h>
int main()

{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b)
    {
        printf("%d %d\n",10*a+1,10*a+2);
    }
    else if(b==a+1)
    {
        printf("%d %d\n",a,b);
    }
    else if(a==9 && b==1)
    {
        printf("99 100\n");
    }
    else
        printf("-1\n");
    return 0;
}

#include "stdio.h"

int main()
{
    int a, b;
    scanf("%d%d", &a, &b);
    if(a==b) printf("%d0 %d1\n", a, b);
    else if(a==b-1) printf("%d9 %d0\n", a, b);
    else if(a==9&&b==1) printf("%d9 %d00\n", a, b);
    else puts("-1");
    return 0;
}

#include<stdio.h>
main()
{
    long long a,b,n,k;
    scanf("%lld%lld",&a,&b);
    if(a==b)
    {
        printf("%lld11 %lld12\n",a,b);
    }
    else if((a+1)==b)
        printf("%lld99 %lld00\n",a,b);
    else if(a==9&&b==1)
        printf("%lld99 %lld000\n",a,b);
    else
        printf("-1\n");
    return 0;

}

#include <stdio.h>
int main(){
	int a, c;
	scanf("%d%d", &a, &c);
	if(a+1 == c){
		printf("%d%d %d%d",a,9,c,0);
	}else if(a==c){
		printf("%d%d %d%d",a,1,c,2);
	}else if(a==9 && c==1){
		printf("%d %d%d",a,c,0);
	}else{
		printf("%d",-1);
	}
	printf("\n");
}

#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    if(a+1==b)
        printf("%d %d",a,b);
    else if(a==b)
        printf("%d %d",a*10,b*10+1);
    else if(a+1==b*10)
        printf("%d %d",a,b*10);
    else
        printf("-1");

}

int main()
{
	int da,db;
	scanf("%d%d",&da,&db);
	if(db-da>1)
	printf("-1");
	if(db-da==1)
	{
		printf("%d",da);
		printf("99\t");
		printf("%d",db);
		printf("00");
	}
      if(db==da)
	{
		printf("%d",da);
		printf("12\t");
		printf("%d",db);
		printf("13");
	}
     if(da==9&&db==1)
	{
		printf("%d",da);
		printf("9\t");
		printf("%d",db);
		printf("00");
	}
	 else if(da>db)
     {
     	printf("-1");
	 }
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a,x,b;
  scanf("%d",&da) ;
  scanf("%d",&db) ;

    if (da==9 && db==1 )
          printf("%d %d ",9 , 10 ) ;

    else if ((abs(db-da)>=2)||(da>db )  )

        printf("-1") ;

    else
     {
         a=da*10;
         b=db*10;
         x=abs(a-b+1);
         printf("%d %d",a+x,a+x+1);
     }

}

#include <stdio.h>

//CODED BY SAYEM MD. NAFI

int main()
{
      int A, B;
      scanf("%d %d", &A, &B);
      if(A - B == -1) printf("%d9 %d0\n", A, B);
      else if(A - B == 0) printf("%d4 %d5\n", A, B);
      else if(A - B == 8) printf("%d9 %d00\n", A, B);
      else printf("-1\n");

      return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main ()
{
    int a, b;
    scanf("%d %d", &a, &b);
    if(b - a == 1) {
       printf("%d99 %d00\n", a, b);
    }
    else if(a == b) {
        printf("%d00 %d01", a, b);
    }
    else if(b - a >= 2) {
        printf("-1");
    }
    else if(a == 9 && b == 1) {
        printf("%d %d0", a, b);
    }
    else if(a - b >= 1) {
        printf("-1");
    }
}

#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b)
    {
        printf("%d %d",a*100,(a*100)+1);
    }
   else if(b-a==1)
    {
        printf("%d %d",a,b);
    }
    else if(a==9 && b==1)
    {
        printf("%d 10",a);
    }
    else
    {
        printf("-1");
    }
    return 0;

}

#include <stdio.h>

int main(void)
{
	int a,b;
	scanf("%d %d", &a, &b);
	if(b-a==-8)
	{
		b=10;
	}
	else if(b==a)
	{
		a=a*10+1;
		b=b*10+2;
	}
	else if(b-a==1)
	{
		a=a;
		b=b;
}
	else
	{
		printf("-1");
		return 0;
	}
	printf("%d %d", a,b);

	return 0;
}

#include <stdio.h>

int main()
{
    int da,db;
    scanf("%i %i",&da,&db);
    int diff=db-da;
    switch(diff){
        case 1:
            printf("%i9 %i0", da,db);
            break;
        case 0:
            printf("%i0 %i1", da ,db);
            break;
        case -8:
            printf("9 10");
            break;
        default:
            printf("-1");
            break;

    }

    return 0;
}

#include<stdio.h>

int main()
{
	int a,b;

	scanf("%d%d",&a,&b);

	if(b == a)
		printf("%d %d",a*10, b*10+1);
	else if(b-a == 1)
		printf("%d %d",b*10-1, b*10);
	else if(a==9 && b==1)
		printf("99 100");
	else
	printf("-1");

	return 0;
}

#include<stdio.h>
main()
{
    long long a,b;
    scanf("%lld%lld",&a,&b);
    if(a==b)
    {
        printf("%lld12 %lld13\n",a,b);
    }
    else if((a+1)==b)
        printf("%lld99 %lld00\n",a,b);
        else if(a==9&&b==1)
        {
            printf("%lld99 %lld000\n",a,b);
        }

    else
        printf("-1\n");
    return 0;

}

#include<stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b){
    printf("%d00 %d01\n",a,b);
    }
    else if(a+1==b){
    printf("%d %d\n",a,b);
    }
    else if(a==9&&b==1){
    printf("%d %d0\n",a,b);
    }
    else {
    printf("-1\n");
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d%d", &a, &b);
    int result = b - a;
    if (result == 0)
        printf("%d %d\n", (a*10), (b*10)+1);
    else if (result == 1)
        printf("%d %d\n", (a*10)+9 , (b*10));
    else if (a == 9 && b == 1)
        printf("%d %d\n", (a*10)+9, (b*10)*10);
    else
        printf("-1\n");

    return 0;
}

#include <stdio.h>

int main()
{
    int d_a, d_b, a, b;

    scanf("%d%d", &d_a, &d_b);

    if(d_a > d_b)
    {
        if(d_a - d_b == 8)
            printf("9 10");
        else
            printf("-1");
    }
    else if(d_a == d_b)
    {
        a = 10 * d_a;
        b = 10 * d_b + 1;

        printf("%d %d", a, b);
    }
    else if(d_a < d_b)
    {
        if(d_b - d_a == 1)
        {
            a = 10 * d_a + 9;
            b = 10 * d_b;

            printf("%d %d", a, b);
        }
        else if(d_b - d_a > 1)
        {
            printf("-1");
        }
    }

    return 0;
}

#include<stdio.h>
int main()
{
    int a,b,c,d,k;
    scanf("%d %d",&c,&d);
    if(c==d)
    {
        a=c*10;
        b=a+1;
        printf("%d %d\n",a,b);
    }
    else if(d-c==1)
    {
        printf("%d %d\n",c,d);
    }
    else if(c==9&&d==1)
    {
        printf("9 10\n");
    }
    else
    {
        printf("-1\n");
    }
    return 0;
}

#include<stdio.h>
#define sf scanf
#define pf printf
int main()
{
    int a,b;
    sf("%d %d",&a,&b);
    if(a==b)
        pf("%d %d\n",a*10,b*10+1);
    else if(a==9&&b==1)
        pf("%d %d\n",9,10);
    else if(b==a+1)
        pf("%d %d\n",a,b);
    else
        pf("%d\n",-1);

}

#include<stdio.h>

void solve(int da, int db, int *a, int *b);

int main(){

	int da, db, a, b;

	scanf("%d %d", &da, &db);

	solve(da, db, &a, &b);

	if(a > 0 && b > 0){

		printf("%d %d", a, b);

	}

	else{

		printf("%d", -1);

	}

	return 0;

}

void solve(int da, int db, int *a, int *b){

	if(db == da + 1){

		*a = da;
		*b = db;

	}

	else if(db == da){

		*a = 10 * da;
		*b = 1 + 10 * db;

	}

	else if(da == 9 && db == 1){

		*a = 9 + 10 * da;
		*b = 100 * db;

	}

	else{

		*a = -1;
		*b = -1;

	}

}

#include<stdio.h>
int main()
{
    long long int a,b;
    scanf("%lld %lld",&a,&b);
    if((a-b)==-1)
    {
        printf("%lld %lld\n",a,b);
    }
    else if(a-b==0)
    {
        a=a*10;
        b=b*10+1;
        printf("%lld %lld\n",a,b);
    }
    else if(a%10==9&&b==1||b%10==0)
    {
        b=a+1;
        printf("%lld %lld\n",a,b);
    }
    else printf("-1\n");
}

#include<stdio.h>
int main(){
	int a, b;
	scanf("%d%d", &a, &b);
	if(a==9 && b==1) printf("9 10");
	else if(a>b || b-a>1) printf("-1");
	else if(b-a == 1) printf("%d %d", a*10 +9, b*10);
	else if(a == b) printf("%d %d", a*10 +1, b*10 +2);
	return 0;
}

#include <stdio.h>

int main(){
    int a,b;
    scanf("%i%i",&a,&b);
    if(a==9 && b==1)
        printf("%i %i0",a,b);
    else if(a==b){
        printf("%i1 %i2",a,b);
    }
    else if(b-a==1)
        printf("%i9 %i0",a,b);
    else
        printf("-1");

  return 0-0-0;
}

#include<stdio.h>
int main()
{
    int x,y;
    scanf("%d%d",&x,&y);
    if(x==y)
        printf("%d %d",x*10, y*10+1);
    else if(x+1==y)
        printf("%d %d",x, y);
    else if(x==9 && y==1)
        printf("9 10");
    else
        printf("-1");
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    if(a==9&&b==1)
        printf("99 100");

    else if(a==b)
        printf("%d11 %d12",a,a);
    else if(a<b){
            if(b-a==1)
        printf("%d99 %d00",a,b);
        else
            printf("-1");
    }
    else
        printf("-1");
}

#include<stdio.h>
int main()
{
    int da,db,a,b;
    scanf("%d%d",&da,&db);
    if(da==db)
    {
        a=da*100;
        b=a+1;
        printf("%d %d",a,b);
    }
    else if(db-da==1)
    {
        b=db*100;
        a=b-1;
        printf("%d %d",a,b);
    }
    else if(da==9&&db==1)
    {
        b=db*1000;
        a=b-1;
        printf("%d %d",a,b);
    }
    else
        printf("-1");
    return 0;

}

#include <stdio.h>

long n , a, b, i, k;

int main()
{
	scanf("%d %d", &a, &b);
	if(a == 9 && b == 1) printf("9 10"); else if (a > b) printf("-1");
	else if (b - a > 1) printf("-1");
	else if(b == a) printf("%d %d", a*10 + 1, a*10 + 2);
	else if (b > a) printf("%d %d", a*10 + 9, (a+1)*10 );
}

#include <stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b)printf("%d %d",10*a+1,10*a+2);
    else if(a+1==b)printf("%d %d",a*10+9,b*10);
    else
    {
        if(a==9&&b==1)printf("%d %d",a,b*10);
        else printf("-1");

    }
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

main() {

    char s[50];
    gets(s);
    char *numbera = strtok(s, " ");
	char *numberb = strtok(NULL, " ");

    int a = atoi(numbera);
    int b = atoi(numberb);

    if ((b - a) > 1) {
        printf("-1\n");
        exit(0);
    }
    if (a == 9 && b == 1){
        printf("%d %d\n", 99, 100);

        exit(0);
    }
    if (a > b) {
        printf("-1\n");
        exit(0);
    }
    if (a == b){
        printf("%d %d\n", a * 10, b * 10 + 1);
        exit(0);
    }
    if (b > a){
        printf("%d %d\n", (a * 100) + 99, b * 100);
        exit(0);
    }
}

#include<stdio.h>
int main(void)
{
	int a, b;
	scanf("%d %d", &a, &b);
	if (a == 9 && b == 1)
	{
		printf("9 10");
		return 0;
	}
	if (a > b)
	{
		printf("-1");
	}
	else if (a == b)
	{
		printf("%d %d", a * 10, b * 10 + 1);
	}
	else if (a < b)
	{
		if (b - a > 1)
			printf("-1");
		else
			printf("%d %d", a * 10 + 9, b * 10);
	}
	return 0;
}

#include <stdio.h>
#include <string.h>
int main()
{
   int a,b;
   scanf("%d%d", &a,&b);
   if(a>b)
   {
       if(a==9&&b==1)
       {
           printf("9 10\n");
       }
       else
       {
           printf("-1\n");
       }
   }
   else if(a==b)
   {
       printf("%d1 %d2\n", a,b);
   }
   else
   {
       if(b-a>1)
       {
           printf("-1\n");
       }
       else
       {
           printf("%d %d\n", a,b);
       }
   }
    return 0;
}

#include<stdio.h>
#define lli long long int
int main(void)
{
	lli a,b;
	scanf("%lld %lld",&a,&b);
	if(a<b)
	{
		if(b-a==1)
			printf("%lld9 %lld0\n",a,b);
		else
			printf("-1\n");
	}
	else if(a==b)
		printf("%lld4 %lld5\n",a,b);
	else if(a==9&&b==1)
		printf("99 100\n");
	else
		printf("-1\n");

	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
 int a,b;
 scanf("%d%d",&a,&b);
 if(a==b)
 {
     printf("%d %d",(a*10),(b*10)+1);
 }
 else if(a+1==b)
 {
     printf("%d %d",a,b);
 }
 else if(a==9 && b ==1)
 {
     printf("%d %d",9,10);
 }
 else{
    printf("%d",-1);
 }
return 0;
}

#include <stdio.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b)
    printf("%d1 %d2",a,b);
    else if(a+1==b)
    printf("%d9 %d0",a,b);
    else if(a==9&&b==1)
    printf("99 100");
    else
    printf("-1");
}

#include <stdio.h>
int main()
{
        int a,b;
        scanf("%d%d",&a,&b);
        if(a==b)
            printf("%d %d",a*10,a*10+1);
        else if(b-a==1)
            printf("%d %d",a*10+9,b*10);
        else if(a==9&&b==1)
            printf("9 10");
        else
            printf("-1");
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);

  if(a<b && abs(a-b)==1){
        printf("%d9 %d0\n",a,b);
    }
    else if(a==b){
        printf("%d1 %d2\n",a,b);
    }
  else if(a==9&&b==1){
    printf("%d %d0",a,b);
  }
    else if (abs(a-b)>=2||a>b){
            printf("-1\n");
    }
    return 0;
}

#include<stdio.h>

int main()
{
    int a, b;
    scanf("%d %d", &a, &b);
    if(a==9 && b==1)
    printf("%d %d0\n", a, b);
    else if(a+1==b)
    printf("%d99 %d00\n", a, b);
    else if(a==b)
        printf("%d12 %d13\n", a, b);
    else
        printf("-1\n");
    return 0;
}

#include<stdio.h>
int main(){
    int da,db;
    scanf("%d%d",&da,&db);
    int a,b;
    if(da==db){
        a=da*10+1;
        b=db*10+2;
        printf("%d %d\n",a,b);
    }else if(da+1==db){
        a=da*10+9;
        b=db*10;
        printf("%d %d\n",a,b);
    }else if(da+1==10 && db==1){
        a=da;
        b=10;
        printf("%d %d\n",a,b);

    }else{
        printf("-1\n");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <string.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    int i= (b-a);
    if((a!=9)||(b!=1))
    {
    if(i==0)
    {
        printf("%d2 %d3\n",a,b);
    }
    if(i==1)
    {
        printf("%d9 %d0",a,b);
    }
    if((i!=0) && (i!=1))
    {
         printf("-1");
    }
    }
    if((a==9)&& (b==1))
    {
        printf("%d %d", 9,10);
    }

    return 0;
}

#include <stdio.h>

int main() {
  int a,b;
scanf("%d%d",&a,&b);
if(b-a==0)
printf("%d %d\n",a*10,b*10+1);
else if(b-a==1)
printf("%d %d\n",a*10+9,b*10);
else if(a-b==8)
printf("%d %d\n",a*10+9,b*100);
else
printf("-1\n");
  return 0;
}

#include <stdio.h>
int main ()
{
	int a,b;
	//Just in case
	//WistfulPeace_7
	scanf ("%d%d",&a,&b);
	if(b-a==0)
		printf("%d12 %d13\n",a,b );
	else if (b-a==1)
		printf("%d99 %d00\n",a,b);
	else if (a==9 && b==1)
		printf("%d99 %d000\n",a,b);
	else if (b-a>1 || b-a<0)
		printf("-1\n");
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int da,db,a,b,res,i,j,sub;
    scanf("%d%d",&da,&db);
    sub=db-da;
    if(da==9&&db==1){
        printf("999 1000\n");
    }
    else if(sub>1||sub<0||da>db){
        printf("-1\n");
    }
    else if(sub==0){
            a=da*100;
            b=a+1;
            printf("%d %d\n",a,b);
    }
    else if(sub==1){
            b=db*100;
            a=b-1;
            printf("%d %d\n",a,b);
    }
}

#include<stdio.h>

int main()
{
	int da, db;

	scanf("%d %d", &da, &db);

	if(da == 9 && db == 1)
	printf("9 10");
	else if(db - da > 1 || da > db)
	printf("-1");
	else if(da == db)
	printf("%d %d", (da*10)+1, (db*10)+2);
	else
	printf("%d %d", (da*10)+9, db*10);

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a;
  scanf("%d",&da) ;
    scanf("%d",&db) ;
    if ((abs(db-da)>=2)||(da>db))
        printf("-1") ;
    else
      {  a=da*100;

        if (db-da==1)

           printf("%d, %d" , a+99 , a+99+1);
        else if (db-da==0)
         printf("%d ,%d" , a+1 , a+1+1);

         }
}

#include <stdio.h>
#include<math.h>
int main()
{
	int a, b;
	scanf("%d %d", &a, &b);
	int d = abs(a - b);
	if (d>1)printf("-1\n");
	else {
		if (d) {
			a = a * 10 + 9; b = b * 10;
		}
		else if (a == 9 && b == 1)printf("9 10\n");
		else {
			a = a*10 + 1;
			b = b*10 + 2;
		}
		printf("%d %d\n", a, b);
	}
	return 0;
}

#include<stdio.h>
#define sf scanf
#define pf printf
int main()
{
    int a,b;
    sf("%d %d",&a,&b);
    if(a==b)
        pf("%d %d\n",a*10,b*10+1);
    else if(a==9&&b==1)
        pf("%d %d\n",a*10,b*10+1);
    else if(b==a+1)
        pf("%d %d\n",a,b);
    else
        pf("%d\n",-1);

}

#include<stdio.h>
#include<math.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if((a==9 && b==1))
    printf("9 10");
    else if((a-b)>1)
    printf("-1");
    else if((a-b)==0)
    printf("%d12 %d13",a,b);
    else if((a-b)==1)
    printf("%d99 %d00",a,b);
}

#include <stdio.h>
#include <stdlib.h>
int main()
{

int x,y,z;
scanf("%d %d", &x, &y);

if(x==y)
{
    x=x*100+12;
    y=x+1;
    printf("%d %d", x,y);
}else if(x+1==y)
{
    z = x*100+99;
    y = z+x;
    printf("%d %d", z,y);
}else if(x==9 && y==1)
{
    y = y*10;
    printf("%d %d", x,y);
}else printf("-1");

    return 0;
}

#include<stdio.h>

int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    if(a==b)
        printf("%d1 %d2\n",a,b);
    else if(a+1==b)
        printf("%d %d",a,b);
    else if(a==1 && b==9)
        printf("9 10\n");
    else
        printf("-1\n");
return 0;
}

#include<stdio.h>
int main()
{
    int n,x,y,a,b;
    scanf("%d%d",&a,&b);
    if(a>b)
    {
        n=a-b;
        if(n==1)
        {
            printf("%d00 %d99\n",a,b);
        }
        else
        {
            printf("-1\n");
        }

    }
    else
    {
        n=b-a;
        if(n==1)
        {
            printf("%d99 %d00\n",a,b);
        }
        else if(n==0)
        {
            printf("%d12 %d13\n",a,b);
        }
        else
        {
            printf("-1\n");
        }

    }

    return 0;
}

#include<stdio.h>
int main(){
	int a, b;
	scanf("%d%d", &a, &b);
	if(a-b>1 || b-a>1) printf("-1");
	else if(a==9 && b==1) printf("9 10");
	else if(a-b == 1) printf("%d %d", a, b);
	else if(b-a == 1) printf("%d %d", a*10 +9, b*10);
	else if(a == b) printf("%d %d", a*10 +1, b*10 +2);
	return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(abs(a-b)>1)
    printf("-1");
    if(abs(a-b)==0)
    printf("%d12 %d13",a,b);
    if(abs(a-b)==1)
    printf("%d99 %d00",a,b);
}

#include<stdio.h>

void check(int da, int db){
     int a, b;
     if(da > db){
          printf("-1");
     }
     else if(da == db){
          a = da * 100 + 10;
          b = db * 100 + 11;
          printf("%d %d", a, b);
     }
     else{
          if(da + 1 == db){
               a = da * 100 + 99;
               b = db * 100;
               printf("%d %d", a, b);
          }
          else
               printf("-1");
     }
}

int main(){
     int da, db;
     scanf("%d%d", &da, &db);

     check(da, db);

     return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a,b;
  scanf("%d",&da) ;
    scanf("%d",&db) ;
    if ((abs(db-da)>2)||(da>db))
        printf("-1") ;
    else
      {  a=da*100;
         b=db*100;
        if (abs(da-db)==1)

           printf("%d, %d" , a+99 , a+99+1);
        else if (da-db==0)
         printf("%d ,%d" , a+1 , a+1+1);

         }
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <string.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    int i= (b-a);
    if((a!=9)&&(b!=0))
    {
    if(i==0)
    {
        printf("%d2 %d3\n",a,b);

    }
    if(i==1)
    {
        printf("%d9 %d0",a,b);
    }
    if((i!=0) && (i!=1))
    {
        printf("%d",-1);
    }
    }
    else
    {
        printf("%d %d", 9,10);
    }
    return 0;
}

#include <stdio.h>
int main(void)
{
    int da, db;
    scanf("%d %d", &da, &db);
    if(da == db + 1 || da == db - 1)
    {
        printf("%d%d %d%d\n", da, 9, db, 0);
    }
    else if( da == db)
        printf("%d%d %d%d\n", da, 5, db, 6);
    else
        printf("-1\n");

    return 0;
}

#include <stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b)printf("%d %d",10*a+1,10*a+2);
    else if(a+1==b)printf("%d %d",a*10+9,b*10);
    else printf("-1");
    return 0;
}

#include <stdio.h>
int main()
{
    int a, b;
    scanf("%d %d", &a, &b);
    if (b - a > 1 || b - a < 0)
    {
        printf("-1");
    }
    else if (b - a == 1)
    {
        printf("%d99 %d00", a, b);
    }
    else
    {
        printf("%d01 %d02", a, b);
    }
    return 0;
}

#include <stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
long long cmpfunc (const void * a, const void * b) {
   return ( *(long long*)a - *(long long*)b );
}

int main(void){

long long int test,i,j,n,count,flag=0,o1=0,o2=0,b1,x,m,l,max,sum2,min,f,k,r,o,sum1,sum=0,count1=0,a[200000]={1},c[200000]={0};
scanf("%lld%lld",&n,&m);
if(abs(n-m)>=2){
    printf("-1");
}else{
    if(n==m){
        printf("%lld %lld",n*10,n*10+1);
    }else{
        if(n<m){
        printf("%lld %lld",m*10-1,m*10);
        }else{
            printf("-1");
        }
    }
}
return 0;
}

#include<stdio.h>
int main()
{
    int n,x,y,a,b;
    scanf("%d%d",&a,&b);
    if(a==b)
    {
        printf("%d %d\n",a,b+1);
    }
    else if(a+1==b)
    {
        printf("%d %d\n",a+198,b+198);
    }
    else
    printf("-1\n");

    return 0;
}

#include <stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b)printf("%d %d",10*a+1,10*a+2);
    if(a+1==b)printf("%d %d",a*10+9,b*10);
    else printf("-1");
    return 0;
}

#include<stdio.h>

int main(){
	int a, b;
	scanf("%d %d", &a, &b);
	if(a+1!=b && a!=b){
		puts("-1");
		return 0;
	}
	a*=10;
	b*=10;
	if(a==b) ++b;
	else a+=9;
	printf("%d %d\n", a, b);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a,b;
  scanf("%d",&da) ;
    scanf("%d",&db) ;
    if ((abs(db-da)>=2)||(da>db))
        printf("-1") ;
    else
      {  a=da*100;
         b=db*100;
        if (db-da==1)

           printf("%d, %d" , a+99 , a+99+1);
        else if (db-da==0)
         printf("%d ,%d" , a+1 , a+1+1);

         }
}

#include<stdio.h>

int main()
{
	int da,db;
	scanf("%d%d",&da,&db);
	if(db-da>1)
	printf("-1");
	if(db-da==1)
	{
		printf("%d",da);
		printf("99\t");
		printf("%d",db);
		printf("00");
	}
      if(db==da)
	{
		printf("%d",da);
		printf("12\t");
		printf("%d",db);
		printf("13");
	}
     if(da==9&&db==1)
	{
		printf("%d",&da);
		printf("9");
		printf("%d",&db);
		printf("00");
	}
	else if(da>db)
     {
     	printf("-1");
	 }
}

#include<stdio.h>
main()
{
    long long a,b,n,k;
    scanf("%lld%lld",&a,&b);
    if(a==b)
    {
        printf("%lld11 %lld12\n",a,b);
    }
    else if((a+1)==b)
        printf("%lld99 %lld00\n",a,b);
    else
        printf("-1\n");
    return 0;

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a,x,b;
  scanf("%d",&da) ;
  scanf("%d",&db) ;
    if ((abs(db-da)>=2)||(da>db))
        printf("-1") ;

    else
     {
         a=da*10;
         b=db*10;
         x=abs(a-b+1);
         printf("%d %d",a+x,a+x+1);
     }

}

#include <stdio.h>
#include <stdlib.h>
int main()
{

int x,y,z;
scanf("%d %d", &x, &y);

if(x==y)
{
    x=x*103;
    y=x+1;
    printf("%d %d", x,y);
}else if(x+1==y)
{
    z = x*100+99;
    y = z+x;
    printf("%d %d", z,y);
}else if(x==9 && y==1)
{
    y = y*10;
    printf("%d %d", x,y);
}else printf("-1");

    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);

  if(abs(a-b)==1){
        printf("%d9 %d0\n",a,b);
    }
    else if(a==b){
        printf("%d1 %d2\n",a,b);
    }
  else if((a==9&&b==1)||(a==1&&b==9)){
    printf("%d %d0",a,b);
  }
    else printf("-1\n");

    return 0;
}

main(a, b) {
	scanf("%d%d", &a, &b);
	if (a == b)
		printf("%d00 %d01", a, b);
	else if (a + 1 == b)
		printf("%d %d", a, b);
	else
		puts("-1");
}

#include<stdio.h>

int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    if(b-a==1)
        printf("%d9 %d0",a,b);
    else if(a==b)
        printf("%d0 %d1",a,b);
    else
        printf("-1\n");
}

#include<stdio.h>
int main(void)
{
	int a, b;
	scanf("%d %d", &a, &b);
	if (a == 1 && b == 9)
	{
		printf("10 9");
		return 0;
	}
	if (a == 9 && b == 1)
	{
		printf("9 10");
		return 0;
	}
	if (a > b)
	{
		printf("-1");
	}
	else if (a == b)
	{
		printf("%d %d", a * 10, b * 10 + 1);
	}
	else if (a < b)
	{
		if (b - a > 1)
			printf("-1");
		else
			printf("%d %d", a * 10 + 9, b * 10);
	}
	return 0;
}

#include <stdio.h>

//CODED BY SAYEM MD. NAFI

int main()
{
      int A, B;
      scanf("%d %d", &A, &B);
      if(A - B == -1) printf("%d9 %d0\n", A, B);
      else if(A - B == 0) printf("%d4 %d5\n", A, B);
      else printf("-1\n");

      return 0;
}

#include<stdio.h>
int main()
{
    long long int a,b;
    scanf("%lld %lld",&a,&b);
    if((a-b)==-1)
    {
        a=a*10+9;
        b=b*10+0;
        printf("%lld %lld\n",a,b);
    }
    else if(a-b==0)
    {
        a=a*10;
        b=b*10+1;
        printf("%lld %lld\n",a,b);
    }
    else printf("-1\n");
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a;
  scanf("%d",&da) ;
    scanf("%d",&db) ;
    if ((abs(db-da)>=2)||(da>db))
        printf("-1") ;
    else
      {  a=da*10;

        if (db-da==1)

           printf("%d, %d" , a+99 , a+99+1);
        else if (db-da==0)
         printf("%d ,%d" , a+1 , a+1+1);

         }
}

#include<stdio.h>

int main()
{
	int da,db;
	scanf("%d%d",&da,&db);
	if(db-da>1)
	printf("-1");
	if(db-da==1)
	{
		printf("%d",da);
		printf("99\t");
		printf("%d",db);
		printf("00");
	}
	if(db==da)
	{
		printf("%d",da);
		printf("12\t");
		printf("%d",db);
		printf("13");
	}
}

#include<stdio.h>

int main(){

    long int n,i,j,k;

    scanf("%ld%ld",&i,&j);

    if(i==j){

        j=(i*10);
        printf("%ld %ld",j,(j+1));
    }
    else if(i==9 && j==1){
        printf("9 1");
    }
    else if((j-i)==1){

        printf("%ld %ld",i,j);
    }
    else
        printf("-1");

    return 0;
}

/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>
#include <string.h>

int main()
{
  int l,m,i,p;
scanf("%d %d",&m,&p);
if(m<p && (p-m)==1)
{
    printf("%d%d %d%d",m,9,p,0);
}
else if(m==p)
{
  printf("%d%d %d%d",m,1,p,2);
}
else
{
      printf("%d",-1);
}
  return 0;
}

#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	if(a==b)
	{
		a=a*10;
		b=a+1;
		printf("%d %d\n",a,b);
	}
	else if(a+1==b)
	{
		a=a*10+9;
		b=b*10;
		printf("%d %d\n",a,b);
	}
	else printf("-1\n");
	return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if((a==9 && b==1)||(a==1 && b==9))
    printf("9 10");
    else if(abs(a-b)>1)
    printf("-1");
    else if(abs(a-b)==0)
    printf("%d12 %d13",a,b);
    else if(abs(a-b)==1)
    printf("%d99 %d00",a,b);
}

#include <stdio.h>
int main(){
    int a,b;
    scanf("%i %i",&a,&b);
    int c = b-a;
    switch ( c ){
        case 1:
                printf("%i9 %i0",a,b);
                break;
        case 0:
               printf("%0 %i1", a,b);
                break;
        case -8:
                printf("9 10");
                 break;
        default:
                printf("-1");
                break;
    }
    return 0;
}

#include<stdio.h>
int main(void)
{
	int a, b;
	scanf("%d %d", &a, &b);
	if (a == 1 && b == 9)
	{
		printf("10 9");
		return 0;
	}
	if (a > b)
	{
		printf("-1");
	}
	else if (a == b)
	{
		printf("%d %d", a * 10, b * 10 + 1);
	}
	else if (a < b)
	{
		if (b - a > 1)
			printf("-1");
		else
			printf("%d %d", a * 10 + 9, b * 10);
	}
	return 0;
}

#include<stdio.h>

int main()
{
	int da, db;

	scanf("%d %d", &da, &db);

	if(da == 9 && db == 1)
	printf("9 10");
	else if(db - da > 1 || da - db > 1)
	printf("-1");
	else if(da == db)
	printf("%d %d", (da*10)+1, (db*10)+2);
	else
	printf("%d %d", (da*10)+9, db*10);

	return 0;
}

#include<stdio.h>
int main(){
	int a, b;
	scanf("%d%d", &a, &b);
	if(a==9 && b==1) printf("9 10");
	else if(a-b>1 || b-a>1) printf("-1");
	else if(a-b == 1) printf("%d %d", a, b);
	else if(b-a == 1) printf("%d %d", a*10 +9, b*10);
	else if(a == b) printf("%d %d", a*10 +1, b*10 +2);
	return 0;
}

#include <stdio.h>

int main() {
  int a,b;
scanf("%d%d",&a,&b);
if(b-a==0)
printf("%d %d\n",a*10,b*10+1);
else if(b-a==1)
printf("%d %d\n",a*10+9,b*10);
else
printf("-1\n");
  return 0;
}

#include<stdio.h>
#define sf scanf
#define pf printf
int main()
{
    int a,b;
    sf("%d %d",&a,&b);
    if(a==b)
        pf("%d %d\n",a*23,b*23+1);
    else if(a==9&&b==1)
        pf("%d %d\n",a*10,b*10+1);
    else if(a==b-1)
        pf("%d %d\n",a,b);
    else
        pf("%d\n",-1);

}

#include <stdio.h>
int main(){
    int a,b;
    scanf("%i %i",&a,&b);
    int c = a-b;
    switch (c){
        case 1:
                printf("%i9 %i0",a,b);
                break;
        case 0:
               printf("%0 %i1", a,b);
                break;
        case -8:
                printf("9 10");
                 break;
        default:
                printf("-1");
                break;
    }
    return 0;
}

#include<stdio.h>

int main()
{
	int da,db;
	scanf("%d%d",&da,&db);
	if(db-da>1)
	printf("-1");
	if(db-da==1)
	{
		printf("%d",da);
		printf("99\t");
		printf("%d",db);
		printf("00");
	}
     else if(db==da)
	{
		printf("%d",da);
		printf("12\t");
		printf("%d",db);
		printf("13");
	}
    else if(da==9&&db==1)
	{
		printf("%d",&da);
		printf("99");
		printf("%d",&db);
		printf("000");
	}
	else if(da>db)
     {
     	printf("-1");
	 }
}

#include <stdio.h>
int main(){
	int a, c;
	scanf("%d%d", &a, &c);
	if(a+1 == c){
		printf("%d%d %d%d",a,9,c,0);
	}else if(a==c){
		printf("%d%d %d%d",a,1,c,2);
	}else{
		printf("%d",-1);
	}
	printf("\n");
}

#include <stdio.h>

int A(int num)
{
    if(num >= 0)
        return num;
    else
        return (-num);
}

int main()
{
    int d_a, d_b, a, b;

    scanf("%d%d", &d_a, &d_b);

    if(A(d_a - d_b) > 1)
        printf("-1");
    else if(A(d_a - d_b) == 1)
    {
        a = 10 * d_a + 9;
        b = 10 * d_b;

        printf("%d %d", a, b);
    }
    else if(A(d_a - d_b) == 0)
    {
        a = 10 * d_a + 1;
        b = 10 * d_b + 2;

        printf("%d %d", a, b);
    }

    return 0;
}

#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b)
    {
        printf("%d %d",a*100,(a*100)+1);
    }
   else if(b=a+1)
    {
        printf("%d %d",a,b);
    }
    else if(a==9 && b==1)
    {
        printf("%d %d",a,b);
    }
    else
    {
        printf("-1");
    }
    return 0;

}

#include <stdio.h>
int main ()
{
	int a,b;
	//Just in case
	//WistfulPeace_7
	scanf ("%d%d",&a,&b);
	if(b-a==0)
		printf("%d12 %d13\n",a,b );
	else if (b-a==1)
		printf("%d99 %d00\n",a,b);
	else if (b-a>1 || b-a<0)
		printf("-1\n");
	return 0;
}

#include <stdio.h>

int main()
{
    int da,db;
    scanf("%i %i",&da,&db);
    int diff=db-da;
    switch(diff){
        case 1:
            printf("%i9 %i0", da,db);
        case 0:
            printf("%i0 %i1", da ,db);
        case -8:
            printf("9 10");
            break;
        default:
            printf("-1");
            break;

    }

    return 0;
}

#include <stdio.h>

int A(int num)
{
    if(num >= 0)
        return num;
    else
        return (-num);
}

int main()
{
    int d_a, d_b, a, b;

    scanf("%d%d", &d_a, &d_b);

    if(A(d_a - d_b) > 1)
    {
        if(A(d_a - d_b) == 8)
        {
            if(d_a == 9)
            {
                a = 9;
                b = 10 * d_b;

                printf("%d %d", a, b);
            }
            else
                printf("-1");
        }
        else
            printf("-1");
    }
    else if(A(d_a - d_b) == 1)
    {
        a = 10 * d_a + 9;
        b = 10 * d_b;

        printf("%d %d", a, b);
    }
    else if(A(d_a - d_b) == 0)
    {
        a = 10 * d_a + 1;
        b = 10 * d_b + 2;

        printf("%d %d", a, b);
    }

    return 0;
}

#include<stdio.h>
int main()
{
    int a,b,c;
    scanf("%d%d",&a,&b);
    c=abs(a-b);
    if(c>1)
        printf("-1");
    else if(c==1){
        a=b*100;
        a=a-1;
        printf("%d %d",a,a+1);
    }
    else {
        a=a*100;
        printf("%d %d",a,a+1);
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{

int x,y,z;
scanf("%d %d", &x, &y);

if(x==y)
{
    x=x*100+12;
    y=x+1;
    printf("%d %d", x,y);
}else if(x+1==y)
{
    z = x*100+99;
    y = z+x;
    printf("%d %d", z,y);
}else if(x==9 && y==1)
{
    x = x *100 + 99;
    y = x+1;
    printf("%d %d", x,y);
}else printf("-1");

    return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    int n,a,b,m,p,temp,q;
    scanf("%d%d",&a,&b);

    m=abs(a-b);
     if(m==1&&a<b)
            {
                p=(b*100)-1;
                q=p+1;
                printf("%d %d",p,q);
            }
            else if(m==0&&a==b)
            {
                p=(a*100)+(a+b)+a;
                q=p+1;
                printf("%d %d",p,q);

            }
            else if(m==8&&a>b)
          {
              p=a;
              q=p+1;
              printf("%d %d",p,q);
          }
          else if(a>b)
            printf("-1");

        }

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a,x,b;
  scanf("%d",&da) ;
    scanf("%d",&db) ;
    if ((abs(db-da)>=2)||(da>db))
        printf("-1") ;
    else
     {

         a=da*10;
         b=db*10;
         x=abs(a-b+1);
         printf("%d,%d",a+x,a+x+1);
     }

}

#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==b){

        printf("%d00 %d01\n",a,b);
        }
    else if(a<b){
        if(b-a>=2)
    printf("-1\n");
        else
        printf("%d99 %d00\n",a,b);
        }
    else{
        printf("-1\n");
    }

}

#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	if(a==b)
	{
		a=a*10;
		b=a+1;
		printf("%d %d\n",a,b);
	}
	else if(a+1==b)
	{
		a=a*10+9;
		b=b*10;
		printf("%d %d\n",a,b);
	}
	else printf("-1\n");
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a,x,b;
  scanf("%d",&da) ;
    scanf("%d",&db) ;
    if ((abs(db-da)>=2)||(da>db))
        printf("-1") ;
    else
     {
         a=da*10;
         b=db*10;
         x=abs(a-b+1);
         printf("%d,%d",a+x,a+x+1);
     }

}

#include <stdio.h>

int main(void)
{
	int a,b;
	scanf("%d %d", &a, &b);
	if(b-a==-8)
	{
		b=10;
	}
	else if(b==a)
	{
		a=a*10+1;
		b=b*10+2;
	}
	else if(abs(b-a)>=2)
	{
		printf("-1");
		return 0;
	}
	printf("%d %d", a,b);

	return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int da,db,a,b,res,i,j,sub;
    scanf("%d%d",&da,&db);
    sub=db-da;
    if(sub>1||sub<0||da>db){
        printf("-1\n");
    }
    else if(sub==0){
            a=da*100;
            b=a+1;
            printf("%d %d\n",a,b);
    }
    else if(sub==1){
            b=db*100;
            a=b-1;
            printf("%d %d\n",a,b);
    }
}

#include<stdio.h>
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a==b||b-a==1){
		if(a==b){
			printf("%d1 %d2",a,b);
		}else{
			printf("%d9 %d0",a,b);
		}
	}else{
		printf("-1");
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
  int da , db ,a,x,b;
  scanf("%d",&da) ;
  scanf("%d",&db) ;

    if ((abs(db-da)>=2)||(da>db )  )
        printf("-1") ;

    else
     {
         a=da*10;
         b=db*10;
         x=abs(a-b+1);
         printf("%d %d",a+x,a+x+1);
     }

}

#include <stdio.h>
int modul(int x){
  if(x<0)
    return -x;
  return x;
}
int main(){
  int a, b;
  scanf("%d%d", &a, &b);
  if(a+1==b)
    printf("%d %d", a, b);
  else if(a==b)
    printf("%d0 %d1", a, b);
  else
    printf("-1");
  return 0;
}

#include<stdio.h>
int main()
{
    int a,b,diff;
    scanf("%d %d",&a,&b);
    if(a>=b)
        diff=a-b;
    else diff=b-a;
    if(diff>1&&diff!=8)
        printf("-1\n");
    else if(diff==0)
        printf("%d %d\n",100*a,100*a+1);
    else if(diff==1)
        {
           if(a<b)
             printf("%d %d\n",100*a+99,100*b);
           else
               printf("%d %d\n",100*b+99,100*a);
        }
    else if(diff==8&&b<a)
        printf("9 10\n");
    else if(diff==8&&b>a)
        printf("-1\n");

    return 0;
}