// Chapter 17, exercise 03: function that replaces all upercase characters in a
// C-style string with their lowercase equivalents. No standard library
// functions!

#include <string>
#include <iostream>
using namespace std;

void to_lower(char* s) {
	for (int i = 0; s[i]; ++i) {
		if (s[i] >= 'A' && s[i] <= 'Z')
			s[i] += 'a' - 'A';
	}
}

void print_array(char* s) {
	for (int i = 0; s[i]; ++i) {
		cout << s[i];
	}
}

void test(string s) {
	to_lower(&s[0]);
	print_array(&s[0]);
	cout << "\n";
}

int main() {
	string s;
	while (cin >> s && s != "quit")
		test(s);
}

/*
doG
dog
123
123
DOG
dog
CAT DOG
cat
dog
*/