import java.util.Scanner;
public class Main
{
public static void main(String[] args) throws IOException
{
Scanner sc = new Scanner(System.in);
int[] arr = {1, 1, 2, 2, 2, 8};
int[] arr2 = new int[6];
for(int i = 0; i < arr.length; i++)
{
arr2[i] = sc.nextInt();
arr2[i] = arr[i] - arr2[i];
}
for(int i : arr2)
System.out.printf("%d ", i);
}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int king = 1;
int queen = 1;
int rook = 2;
int bishop = 2;
int knight = 2;
int pawn = 8;
StringTokenizer st = new StringTokenizer(br.readLine(), " ");
king = king - Integer.parseInt(st.nextToken());
queen = queen - Integer.parseInt(st.nextToken());
rook = rook - Integer.parseInt(st.nextToken());
bishop = bishop - Integer.parseInt(st.nextToken());
knight = knight - Integer.parseInt(st.nextToken());
pawn = pawn - Integer.parseInt(st.nextToken());
System.out.print(king + " ");
System.out.print(queen + " ");
System.out.print(rook + " ");
System.out.print(bishop + " ");
System.out.print(knight + " ");
System.out.print(pawn + " ");
}
}
StringTokenizer 쓰기 귀찮아서 Scanner썼는데 느리긴 느리다.