## CJam, <s>34</s> 31 bytes qN/W%zSf-La%{_{s'*&}#_)@@=}3*;\ This requires the input to be padded to a rectangle with spaces. [Try it online!][2] Alternatively, [run all test cases.][1] ### Explanation qN/ e# Read input and split into lines. W%z e# Rotate 90° counter-clockwise. Sf- e# Remove all spaces from the rows. La% e# Split into buildings. We've now got a 3D array of rooms, where the first e# dimension is the building, the second the room number and the third is the e# the floor number. { e# Run this block three times. At each stage it will find the index of the "*" e# along the current dimension and leave the element at that index on the stack e# for the next round... _ e# Duplicate the current array. { e# Find the index of the first element where this block yields something e# truthy... s e# Flatten into a single string. '*& e# Set intersection with "*". }# _) e# Duplicate the index and increment it, because the results should be 1-based. @@= e# Pull up the array and the other copy of the index and select the e# corresponding element. }3* ;\ e# We've now got the building, room and floor index on the stack, as well as the e# "*" character itself. We discard the character and swap the room and the floor e# floor number. When the three indices are printed back-to-back at the end of e# the program, that will yield the desired result. [1]: http://cjam.tryitonline.net/#code=cU4yKi97Ti9feixme1NlXXN9Tio6UTsKClFOL1clelNmLUxhJXtfe3MnKiZ9I18pQEA9fTMqO1wKCl1vTm99Lw&input=KgoKIyAgIyAgKiAgIyAgIwoKIyMjIyMKIyMjIyMKIyMjIyoKIyMjIyMKIyMjIyMKCiAgICAgICAgICMjIyMjCiAgICAgICAgICMjIyMjICAgICAgICAgICAjIyMjIyMKICAgICAgICAgIyMjIyMgICAgICAgICAgICMjIyMjIwojICAjICAjICAjIyMjIyAgIyAgIyAgIyAgIyMjIyMjICAqCgojCiMgICMKIyAgIyAgIyMKIyAgIyAgIyMgICMjIwojICAjICAjIyAgIyMjICAjIyMjIwojICAjICAjIyAgIyMjICAjIyojIyAgIyMjIyMjIyMKIyAgIyAgIyMgICMjIyAgIyMjIyMgICMjIyMjIyMjCgogICAgICAgICAgICMKICAgICAgICAgICAqCiAgICAgICAgICAgIwogICAgICAgICAgICMKICAgICAgICAgICAjCiAgICAgICAgICAgIwogICAgICAgICAgICMKICAgICAgICAgICAjCiMjIyMjIyMjIyAgIyAgIwoKICAgICAgICAgICAgICAgICAgICAgICAgIyMjIyMjIyMqCiAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyMjIwogICAgICAgICAgICAgICAgICAgICAgICAjIyMjIyMjIyMKICAgICAgICAgICAgICAgICAgICAgICAgIyMjIyMjIyMjCiAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyMjIwogICAgICAgICAgICAgICAgICAgICAgICAjIyMjIyMjIyMKICAgICAgICAgICAgICAgICAgICAgICAgIyMjIyMjIyMjCiAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyMjIwojICAjICAjICAjICAjICAjICAjICAjICAjIyMjIyMjIyM [2]: http://cjam.tryitonline.net/#code=cU4vVyV6U2YtTGEle197cycqJn0jXylAQD19Myo7XA&input=ICAgICAgICAgIyMjIyMgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAjIyMjIyAgICAgICAgICAgIyMjIyMjICAgCiAgICAgICAgICMjIyMjICAgICAgICAgICAjIyMjIyMgICAKIyAgIyAgIyAgIyMjIyMgICMgICMgICMgICMjIyMjIyAgKg