/*
#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
const int qx[4]={0,1,0,-1};
const int qy[4]={1,0,-1,0};
int map[200][200];
bool visted[200][200];
struct xy{
public:
int x,y;
};
int main()
{
int a,b,c,d;
int m,n,k;
int i,j,l;
int answer = 0;
int arrsize = 0;
int arr[10000]={0,};
queue<xy> que;
xy p;
scanf("%d%d%d",&m,&n,&k);
for(i = 0;i < k;i++)
{
scanf("%d%d%d%d",&a,&b,&c,&d);
for(j = a;j < c;j++)
{
for(l = b;l < d;l++)
{
map[j][l]++;
}
}
}
for(i = 0;i < n;i++)
{
for(j = 0;j < m;j++)
{
printf(" %d ",map[i][j]);
}
puts("");
}
for(i = 0;i < n;i++)
{
for(j = 0;j < m;j++)
{
if(map[i][j]==0&&!visted[i][j])
{
p.x = j;
p.y = i;
que.push(p);
answer++;
visted[i][j] = true;
arr[arrsize]++;
while(!que.empty())
{
for(k = 0;k < 4;k++)
{
if(que.front().x+qx[k]<0||que.front().x+qx[k]>=m)
{
continue;
}
if(que.front().y+qy[k]<0||que.front().y+qy[k]>=n)
{
continue;
}
if(map[que.front().y+qy[k]][que.front().x+qx[k]]!=0)
{
continue;
}
if(visted[que.front().y+qy[k]][que.front().x+qx[k]])
{
continue;
}
p.x = que.front().x+qx[k];
p.y = que.front().y+qy[k];
visted[que.front().y+qy[k]][que.front().x+qx[k]] = true;
que.push(p);
arr[arrsize]++;
}
que.pop();
}
arrsize++;
}
}
}
sort(arr,arr+arrsize);
printf("%d\n",answer);
for(i = 0;i < arrsize;i++)
{
printf("%d ",arr[i]);
}
/**
수행을축입시다.평가는나의적
공부가3년동안자다가
어떦수행명가가이겨우일어난공부를축엿습니다.
공부은착했습니다.공부는아직않축였는데
아사가지엄는수행에개물렷음니다.
어러분도조심하십시오.
수앵명카 개쌔기 시발Tㅏ가지없는톰
return 0;
}
*/
/*
#include <stdio.h>
#include <string.h>
char kor[11][11] = {"","일","이","삼","사","오","육","칠","팔","구"};
int main()
{
long long int n=0;
int a;
scanf("%lld",&n);
//printf("%s,%d",str,n);
if(n >= 100000000)
{/*
printf("%s%s",kor[n/(100000000*1000)%10],n/(100000000*1000)%10==0?"":"천");
printf("%s%s",kor[n/(100000000*100)%10],n/(100000000*100)%10==0?"":"백");*/
/* printf("%s%s",kor[n/(100000000*10)%10],n/(100000000*10)%10==0?"":"십");
printf("%s%s",kor[n/(100000000*1)%10],n/(100000000*1)%10==0?"":"");
printf("억");
}
if(n >= 10000)
{
a=0;
a+=printf("%s%s",kor[n/(10000*1000)%10],n/(10000*1000)%10==0?"":"천");
a+=printf("%s%s",kor[n/(10000*100)%10],n/(10000*100)%10==0?"":"백");
a+=printf("%s%s",kor[n/(10000*10)%10],n/(10000*10)%10==0?"":"십");
a+=printf("%s%s",kor[n/(10000*1)%10],n/(10000*1)%10==0?"":"");
if(a!=0)
printf("만");
}
if(n >= 1)
{
printf("%s%s",kor[n/(1000)%10],n/(1000)%10==0?"":"천");
printf("%s%s",kor[n/(100)%10],n/(100)%10==0?"":"백");
printf("%s%s",kor[n/(10)%10],n/(10)%10==0?"":"십");
printf("%s%s",kor[n/(1)%10],n/(1)%10==0?"":"");
//printf("억");
}
if(n==0)
{
printf("영");
}
}
*//*
#include<stdio.h>
int main()
{
int n;
int i;
int sum = 0;
scanf("%d",&n);
for( i = 1;i <= n;i++)
{
if(n%i==0)
{
sum+=i;
}
}
printf("%d",sum);
}*//*
#include<stdio.h>
int main()
{
int n;
int i;
int a,b;
int sum = 0;
int up=0,down=0;
scanf("%d",&n);
scanf("%d",&b);
for(i = 1;i < n;i++)
{
scanf("%d",&a);
if(b>a)
{
down++;
}
if(a>b)
{
up++;
}
b = a;
}
printf("%d %d",up,down);
}
*/
#include <stdio.h>
#include <string.h>
int main()
{
int i,j;
char a[50];
int num=0;
scanf("%s",a);
for(i = 0; i<strlen(a); i++)
{
if(a[i]=='H')
{
printf("Hello, world! ");
}
if(a[i]=='Q')
{
printf("%s ",a);
}
if(a[i]=='9')
{
for(j = 99; j>=1; j--)
{
if(j == 1)
{
puts("1 bottle of beer on the wall, 1 bottle of beer.");
puts("Take one down and pass it around, no more bottles of beer on the wall.");
puts("No more bottles of beer on the wall, no more bottles of beer. ");
printf("Go to the store and buy some more, 99 bottles of beer on the wall. ");
}
else if(j == 2)
{
// printf("Take one down and pass it around, 2 bottles of beer on the wall.\n");
puts("2 bottles of beer on the wall, 2 bottles of beer. ");
puts("Take one down and pass it around, 1 bottle of beer on the wall. ");
}
else
{
printf("%d bottles of beer on the wall, %d bottles of beer.\n",j,j);
printf("Take one down and pass it around, %d bottles of beer on the wall.\n",j-1);
}
}
}
if(a[i]=='+')
{
num++;
}
}
}
///1917