#include <iostream>
#include <sstream>
using namespace std;

int main() {
  int a, b, N;
  stringstream ss;
  while (cin >> a >> b) {
    ss << a + b;
    N = ss.str().size() - 1;
    cout << ss.str()[N] << endl;
  }
  return 0;
}