module.exports=function(r){var t={};function e(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return r[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=r,e.c=t,e.d=function(r,t,n){e.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:n})},e.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},e.t=function(r,t){if(1&t&&(r=e(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var i in r)e.d(n,i,function(t){return r[t]}.bind(null,i));return n},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,"a",t),t},e.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},e.p="",e(e.s=0)}([function(r,t,e){"use strict";var n=e(1);e(2)(n.readFileSync("/dev/stdin","utf8"))},function(r,t){r.exports=require("fs")},function(r,t,e){"use strict";var n=e(3),i=e(5);r.exports=function(r){var t=new n(r);i(t)}},function(r,t,e){"use strict";var n=e(4);r.exports=class{constructor(r){var t=r.trim().split(/\s+/g);this.inp=new n(t)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(r,t,e){"use strict";r.exports=class{constructor(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=r.length,this.items=r,this.ind=0}enq(r){this.size+=1,this.items.push(r)}deq(){var r=this.items[this.ind];return this.size-=1,this.ind+=1,r}clear(){this.items=[],this.size=0,this.ind=0}}},function(r,t,e){"use strict";r.exports=function(r){for(var t=r.in(),e=r.in(),n=(r.in(),new Array(t)),i=0;i<t;i++)n[i]=r.inr().split("");for(var o=0,s=new Array(t).fill(1),u=0;u<t;u++){for(var f=!1,a=0;a<e;a++)"."==n[u][a]?f&&(n[u][a]=o):(f=!0,o+=1,n[u][a]=o);f||(s[u]=0)}for(var c=t-1;c>=0;c--)for(var l=!1,p=e-1;p>=0;p--)"."==n[c][p]?l&&(n[c][p]=o):(l=!0,o=n[c][p]);for(var d=1;d<t;d++)if(1!=s[d]&&0!=s[d-1]){for(var v=0;v<e;v++)n[d][v]=n[d-1][v];s[d]=1}for(var h=t-2;h>=0;h--)if(1!=s[h]&&0!=s[h+1]){for(var y=0;y<e;y++)n[h][y]=n[h+1][y];s[h]=1}for(var b=0;b<t;b++)console.log(n[b].join(" "))}}]);