Start: Feb, 21, 2019 12:00:00
2018-2019 ACM集训队冬季集训第二次考核
End: Feb, 21, 2019 17:00:00
Time elapsed:
Time remaining:

Problem_ID: I
Result: Accepted
Time: 7ms
Memory: 1720kB
Author: 2017212212065
In contest: 1261

#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>

using namespace std;
vector<int> v;
int main(void){
	int a, b, i, sum, start;
	while(scanf("%d",&a)!=EOF){
		v.clear();
		sum = 0;
		for(i = 0;i < a;i++){
			scanf("%d",&b);
			if(v.size()&&v[v.size() - 1] == 1&&b == 1){
				v.pop_back();
			}
			else{
				v.push_back(b);
			}
		}
		if(!v.size()||v[0] == 1&&v.size() != 1){
			printf("L\n");
		}
		else{
			printf("H\n");
		}
	}
	return 0;
}