#include <iostream>
#include <vector>
char last;
using namespace std;
vector<vector<char> > commands;
void Init() {
  vector<char> empty;
  commands.push_back(empty);
 //cout<<"init done"<<endl;
}
void TypeLetter(char L) {
  vector<char> last = commands[commands.size()-1];
  last.push_back(L);
  commands.push_back(last);
  //cout<<"letter added"<<endl;
}
void UndoCommands(int U) {
  vector<char> last = commands[commands.size()-U-1];
  commands.push_back(last);
  //cout<<U<<" commands undone"<<endl;
}
char GetLetter(int P) {
  return commands[commands.size()-1][P];
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |