#include <stdio.h> int main() { int a; while (scanf("%d", &a) != EOF) { printf("%d\n",a%10); } return 0; }