/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
char array[100]={0};
do
{
scanf("%99s", array);
} while (!(strlen(array) == 1 && array[0] == 'Q'));
}