n, T = gets.split.map(&:to_i)
s = gets
ans = 0

for i in 0..s.size()-1
  if "0" < s[i] && s[i] <= "9"
    add = 1
    s[i].to_i.times {|j| add *= n}
    ans += add;
  end
end
ans *= T
if 1e+9 < ans
  puts "TLE"
else
  puts ans
end