import scala.io.Source

object Main extends App {
  val line: String = Source.fromFile(args(0)).getLines.toList.head

  def isCapital(c: Char): Boolean = ('A' to 'Z').toList.contains(c)

  val str = line.map { c => if (isCapital(c)) c.toString.toLowerCase else c.toString.capitalize }

  str.map(print)
}