import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner( System.in );
int h = input.nextInt();
int m = input.nextInt();
whatTimeItIs(h, m);
}
public static void whatTimeItIs(int h, int m) {
String[] hour = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "quarter", "sixteen", "seventeen", "eighteen", "nineteen"};
String result;
boolean greater = false;
if (m == 0) {
result = hour[h-1] + " o' clock";
} else {
if (m > 30) {
m = 60 - m;
greater = true;
}
if(m < 20) {
result = hour[m - 1];
} else if (m == 30){
result = "half";
} else {
result = m==20?"twenty":"twenty "+hour[m%10-1];
}
if(m == 1){
result += " minute";
} else if(m != 15 && m != 30){
result += " minutes";
}
if (!greater) {
result += " past " + hour[h-1];
} else {
result += " to ";
if (h != 12) {
result += hour[h];
} else {
result += "one";
}
}
}
System.out.println(result);
}
}