import 'dart:io';

void main(List<String> arguments) {
  final s = stdin.readLineSync();
  final lower = s.toLowerCase();
  if (s == lower) {
    print(s.toUpperCase());
  } else {
    print(lower);
  }
}
