Write a program to read in a sequence of examination mark from a text file named as input.txt and produce the mean, and standard deviation of the marks. Your program should also produce a bar chart for each grade where the range of mark is given as below.
Grade Marks Range
A 80-100
B 70-79.9
C 50-69.9
D 40-49.9
F 0-39.9
Output the result to another text file named as output.txt.