https://www.acmicpc.net/problem/2475
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int a=s.nextInt();
int b=s.nextInt();
int c=s.nextInt();
int d=s.nextInt();
int e=s.nextInt();
int sum=a*a+b*b+c*c+d*d+e*e;
System.out.format("%d",sum%10);
}
}