#include <stdio.h>

int main() {
	int c;
	while ((c = getchar()) != EOF) {
		int inc = 0;
loop:
		if (c == 'M') {
			int c2 = getchar();
			if (c2 == '-') {
				c = getchar();
				if (c != EOF)
					inc = 1;
				else
					putchar('M'), c = '-';
			} else if (c2 != EOF) {
				putchar(c);
				c = c2;
				goto loop;
			}
		}
		if (c == '\\') {
			c = getchar();
			if (c == EOF)
				c = '\\';
		} else if (c == '^') {
			c = getchar();
			if (c != EOF)
				c &= ~0x40;
			else
				c = '^';
		}
		if (inc)
			c += 128;
		putchar(c);
	}
	return 0;
}
