fun main(args:Array) { val (h, w) = readLine()!!.split(" ").map(String::toInt) val xs = (1..h).map { readLine()!!.toList().toMutableList() } outer@for( hstart in (0..h-1) ) { for( wstart in (0..w-1) ) { val copy = xs.map { it.toMutableList() } copy[hstart][wstart] = '*' if( copy.flatten().filter { it == '*' }.size != 3 ) continue val triples = mutableListOf>() copy.mapIndexed { height, copy_line -> copy_line.mapIndexed { width, char -> if( char == '*' ) triples.add( Pair(height, width) ) } } if( ( triples[0].first == triples[1].first && triples[1].first == triples[2].first ) || ( triples[0].second == triples[1].second && triples[1].second == triples[2].second ) ) continue // 単位ベクトルを作成 val (x, y) = Pair( triples[1].first.toDouble()/triples[0].first, triples[1].second.toDouble()/triples[0].second ) if( triples[2].first.toDouble()/x == triples[2].second.toDouble()/y) continue copy.map { it.joinToString("").run(::println) } break@outer } } }