Farmer Bob has two numbers and
, which can be represented as a string of
s and a string of
s respectively. He wants to find out the product of
and
(which he will call
). Bob soon realizes that
will be extremely big, so he will ask
questions about
instead. For the
question, he wants to know the value of the
digit in
when counting from the left. Can you write a program to help him?
Constraints
For all subtasks:
will not exceed the number of digits in
.
Points Awarded | Additional Constraints |
---|---|
2 points | |
6 points | |
7 points | No further constraints |
Input Specification
The first line contains three integers ,
and
.
The next lines contain an integer
.
Output Specification
Output lines, with the
line containing the answer to the
question.
Sample Input
3 4 2
1
5
Sample Output
9
0
Explanation for Sample
Since and
,
.
Comments