#include<iostream>
#define MAXN 102

using namespace std;

int table[MAXN][MAXN];
int tableT[MAXN][MAXN];
int tableB[MAXN][MAXN];
int tableL[MAXN][MAXN];
int tableR[MAXN][MAXN];

void PRINT(int n)
{
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=n;j++)cout << tableT[i][j] << " ";
        cout << endl;
    }
}

int main()
{
    int n,k;
    cin >> n >> k;

    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            char c;cin >> c;
            table[i][j] = c;
        }
    }
    /*top*/
    for(int i=0;i<=n+1;i++)
    {
        for(int j=0;j<=n+1;j++)
        {
            if(i==0||j==0||i==n+1||j==n+1)tableT[i][j] = 0;
            else if(table[i][j]=='#')tableT[i][j] = 0;
            else tableT[i][j] = tableT[i-1][j]+1;
        }
    }
    /*bot*/
    for(int i=n+1;i>=0;i--)
    {
        for(int j=0;j<=n+1;j++)
        {
            if(i==0||j==0||i==n+1||j==n+1)tableB[i][j] = 0;
            else if(table[i][j]=='#')tableB[i][j] = 0;
            else tableB[i][j] = tableB[i+1][j]+1;
        }
    }
    /*left*/
    for(int j=0;j<=n+1;j++)
    {
        for(int i=0;i<=n+1;i++)
        {
            if(i==0||j==0||i==n+1||j==n+1)tableL[i][j] = 0;
            else if(table[i][j]=='#')tableL[i][j] = 0;
            else tableL[i][j] = tableL[i][j-1]+1;
        }
    }
    /*right*/
    for(int j=n+1;j>=0;j--)
    {
        for(int i=0;i<=n+1;i++)
        {
            if(i==0||j==0||i==n+1||j==n+1)tableR[i][j] = 0;
            else if(table[i][j]=='#')tableR[i][j] = 0;
            else tableR[i][j] = tableR[i][j+1]+1;
        }
    }

    //PRINT(n);

    /*find*/
    int maxship = 0,ship = 0;
    int pi = 0,pj = 0;
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=n;j++,ship=0)
        {
            ship = (tableT[i][j]>=k)+(tableB[i][j]>=k)+(tableL[i][j]>=k)+(tableR[i][j]>=k);
            if(ship > maxship)
            {
                maxship = ship;
                pi = i;pj = j;
            }
        }
    }
    cout << pi << " " << pj;
}


#include<iostream>
#define MAXN 102

using namespace std;

int table[MAXN][MAXN];
int tableT[MAXN][MAXN];
int tableB[MAXN][MAXN];
int tableL[MAXN][MAXN];
int tableR[MAXN][MAXN];

void PRINT(int n)
{
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=n;j++)cout << tableB[i][j] << " ";
        cout << endl;
    }
}

int main()
{
    int n,k;
    cin >> n >> k;

    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            char c;cin >> c;
            table[i][j] = c;
        }
    }
    /*top*/
    for(int i=0;i<=n+1;i++)
    {
        for(int j=0;j<=n+1;j++)
        {
            if(i==0||j==0||i==n+1||j==n+1)tableT[i][j] = 0;
            else if(table[i][j]=='#')tableT[i][j] = 0;
            else tableT[i][j] = tableT[i-1][j]+1;
        }
    }
    for(int i=n+1;i>=0;i--)
        for(int j=0;j<=n+1;j++)
            tableT[i][j] = (tableT[i][j]==0)?0:max(tableT[i+1][j],tableT[i][j]);
    /*bot*/
    for(int i=n+1;i>=0;i--)
    {
        for(int j=0;j<=n+1;j++)
        {
            if(i==0||j==0||i==n+1||j==n+1)tableB[i][j] = 0;
            else if(table[i][j]=='#')tableB[i][j] = 0;
            else tableB[i][j] = tableB[i+1][j]+1;
        }
    }
    for(int i=0;i<=n+1;i++)
        for(int j=0;j<=n+1;j++)
            tableB[i][j] = (tableB[i][j]==0)?0:max(tableB[i-1][j],tableB[i][j]);
    /*left*/
    for(int j=0;j<=n+1;j++)
    {
        for(int i=0;i<=n+1;i++)
        {
            if(i==0||j==0||i==n+1||j==n+1)tableL[i][j] = 0;
            else if(table[i][j]=='#')tableL[i][j] = 0;
            else tableL[i][j] = tableL[i][j-1]+1;
        }
    }
    for(int j=n+1;j>=0;j--)
        for(int i=0;i<=n+1;i++)
            tableL[i][j] = (tableL[i][j]==0)?0:max(tableL[i][j+1],tableL[i][j]);
    /*right*/
    for(int j=n+1;j>=0;j--)
    {
        for(int i=0;i<=n+1;i++)
        {
            if(i==0||j==0||i==n+1||j==n+1)tableR[i][j] = 0;
            else if(table[i][j]=='#')tableR[i][j] = 0;
            else tableR[i][j] = tableR[i][j+1]+1;
        }
    }
    for(int j=0;j<=n+1;j++)
        for(int i=0;i<=n+1;i++)
            tableR[i][j] = (tableR[i][j]==0)?0:max(tableR[i][j-1],tableR[i][j]);

    //PRINT(n);

    /*find*/
    int maxship = 0,ship = 0;
    int pi = 0,pj = 0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++,ship=0)
        {
            ship = (tableT[i][j]>=k)+(tableB[i][j]>=k)+(tableL[i][j]>=k)+(tableR[i][j]>=k);
            if(ship > maxship)
            {
                maxship = ship;
                pi = i;pj = j;
            }
        }
    }
    cout << pi << " " << pj;
}


#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stck:1024000000,1024000000")
#define lowbit(x) (x&(-x))
#define max(x,y) (x>=y?x:y)
#define min(x,y) (x<=y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.1415926535897932384626433832
#define ios() ios::sync_with_stdio(true)
#define INF 0x3f3f3f3f
#define mem(a) ((a,0,sizeof(a)))
typedef long long ll;
char a[106][106];
int vis[106][106];
int n,k;
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++)
        scanf("%s",&a[i]);
    int col=0,row=0,cnt=0,tot=0;
    memset(vis,0,sizeof(vis));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(a[i][j]=='.')
            {
                cnt=0;
                for(int z=j;z<min(n,j+k);z++)
                    if(a[i][z]=='.') cnt++;
                if(cnt==k){
                    for(int z=j;z<min(n,j+k);z++)
                        vis[i][z]++;
                }
                cnt=0;
                for(int z=i;z<min(n,i+k);z++)
                    if(a[z][j]=='.') cnt++;
                if(cnt==k){
                    for(int z=i;z<min(n,i+k);z++)
                        vis[z][j]++;
                }
            }
            if(vis[i][j]>tot)
            {
                tot=vis[i][j];
                row=i;
                col=j;
            }
        }
    }
    printf("%d %d\n",row+1,col+1);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stck:1024000000,1024000000")
#define lowbit(x) (x&(-x))
#define max(x,y) (x>=y?x:y)
#define min(x,y) (x<=y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.1415926535897932384626433832
#define ios() ios::sync_with_stdio(true)
#define INF 0x3f3f3f3f
#define mem(a) ((a,0,sizeof(a)))
typedef long long ll;
char a[106][106];
int vis[106][106];
int n,k;
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++)
        scanf("%s",&a[i]);
    int col=0,row=0,cnt=0,tot=0;
    memset(vis,0,sizeof(vis));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(a[i][j]==".")
            {
                cnt=0;
                for(int z=j;z<min(n,j+k);z++)
                    if(a[i][z]==".") cnt++;
                if(cnt==k){
                    for(int z=j;z<min(n,j+k);z++)
                        vis[i][z]++;
                }
                cnt=0;
                for(int z=i;z<min(n,i+k);z++)
                    if(a[z][j]==".") cnt++;
                if(cnt==k){
                    for(int z=i;z<min(n,i+k);z++)
                        vis[z][j]++;
                }
            }
            if(vis[i][j]>tot)
            {
                tot=vis[i][j];
                row=i;
                col=j;
            }
        }
    }
    printf("%d %d\n",row+1,col+1);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stck:1024000000,1024000000")
#define lowbit(x) (x&(-x))
#define max(x,y) (x>=y?x:y)
#define min(x,y) (x<=y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.1415926535897932384626433832
#define ios() ios::sync_with_stdio(true)
#define INF 0x3f3f3f3f
#define mem(a) ((a,0,sizeof(a)))
typedef long long ll;
char a[106][106];
int vis[106][106];
int n,k;
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++)
        scanf("%s",&a[i]);
    int col=0,row=0,cnt=0,tot=0;
    memset(vis,0,sizeof(vis));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(a[i][j]==‘.‘)
            {
                cnt=0;
                for(int z=j;z<min(n,j+k);z++)
                    if(a[i][z]==‘.‘) cnt++;
                if(cnt==k){
                    for(int z=j;z<min(n,j+k);z++)
                        vis[i][z]++;
                }
                cnt=0;
                for(int z=i;z<min(n,i+k);z++)
                    if(a[z][j]==‘.‘) cnt++;
                if(cnt==k){
                    for(int z=i;z<min(n,i+k);z++)
                        vis[z][j]++;
                }
            }
            if(vis[i][j]>tot)
            {
                tot=vis[i][j];
                row=i;
                col=j;
            }
        }
    }
    printf("%d %d\n",row+1,col+1);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define MOD 1000000007
#define N 100010

#define scd(x) scanf("%d",&x);
#define prd(x) printf("%d\n",x);
#define scl(x) scanf("%lld",&x);
#define prl(x) printf("%lld",x);

#define FOR(i,k,e) for (int i=e ; i<k ; i++)
#define RFOR(i,k,e) for (int i=e ; i>=k ; i--)

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector< pii > vpi;
typedef vector< pll > vpl;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	// int k,n,s,p;
	// cin >> k >> n >> s >> p;
	// int ans = ceil((double)n/s);
	// int temp = ans*k;
	// cout << ceil((double)temp/p);
	int n,k;
	cin >> n >> k;
	int res  = k;
	char a[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			cin >> a[i][j];
		}
	}
	int h[n][n];
	int v[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			h[i][j] = 0;
			v[i][j] = 0;
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[i][j]=='.'){
			while(j<n&&a[i][j]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				h[i][k] =(k+1)-res + min (count-(k+1) ,res-1)+ 1;
			}
		 }
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[j][i]=='.'){
			while(j<n&&a[j][i]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				v[k][i] = (k+1)-res + min (count-(k+1) ,res-1)+ 1;
			}
		 }
		}
	}
	// FOR(i,n,0){
	// 	FOR(j,n,0){
	// 		cout << h[i][j] << " ";
	// 	}
	// 	cout << "\n";
	// }
	int ans1 = 0;
	int ans2 = 0;
	int ans = 0;
	FOR(i,n,0){
		FOR(j,n,0){
			int temp = 0;

			if(h[i][j]>=0){temp = temp + h[i][j];}
			if(v[i][j]>=0){temp = temp + v[i][j];}

			if( temp  > ans){
				ans = temp;
				ans1 = i;
				ans2 = j;
			}
		}
	}

	cout << ans1+1 << " " << ans2+1;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define MOD 1000000007
#define N 100010

#define scd(x) scanf("%d",&x);
#define prd(x) printf("%d\n",x);
#define scl(x) scanf("%lld",&x);
#define prl(x) printf("%lld",x);

#define FOR(i,k,e) for (int i=e ; i<k ; i++)
#define RFOR(i,k,e) for (int i=e ; i>=k ; i--)

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector< pii > vpi;
typedef vector< pll > vpl;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	// int k,n,s,p;
	// cin >> k >> n >> s >> p;
	// int ans = ceil((double)n/s);
	// int temp = ans*k;
	// cout << ceil((double)temp/p);
	int n,k;
	cin >> n >> k;
	int res  = k;
	char a[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			cin >> a[i][j];
		}
	}
	int h[n][n];
	int v[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			h[i][j] = 0;
			v[i][j] = 0;
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[i][j]=='.'){
			while(j<n&&a[i][j]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				h[i][k] =min(res-1,k - temp) + min (count-(k+1) ,res-1)+ 1;
			}
		 }
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[j][i]=='.'){
			while(j<n&&a[j][i]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				v[k][i] = min(res-1,k - temp) + min (count-(k+1) ,res-1)+ 1;
			}
		 }
		}
	}
	// FOR(i,n,0){
	// 	FOR(j,n,0){
	// 		cout << v[i][j] << " ";
	// 	}
	// 	cout << "\n";
	// }
	int ans1 = 0;
	int ans2 = 0;
	int ans = 0;
	FOR(i,n,0){
		FOR(j,n,0){
			int temp = 0;

			if(h[i][j]>=res){temp = temp + h[i][j];}
			if(v[i][j]>=res){temp = temp + v[i][j];}

			if( temp  > ans){
				ans = temp;
				ans1 = i;
				ans2 = j;
			}
		}
	}

	cout << ans1+1 << " " << ans2+1;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define MOD 1000000007
#define N 100010

#define scd(x) scanf("%d",&x);
#define prd(x) printf("%d\n",x);
#define scl(x) scanf("%lld",&x);
#define prl(x) printf("%lld",x);

#define FOR(i,k,e) for (int i=e ; i<k ; i++)
#define RFOR(i,k,e) for (int i=e ; i>=k ; i--)

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector< pii > vpi;
typedef vector< pll > vpl;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	// int k,n,s,p;
	// cin >> k >> n >> s >> p;
	// int ans = ceil((double)n/s);
	// int temp = ans*k;
	// cout << ceil((double)temp/p);
	int n,k;
	cin >> n >> k;
	char a[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			cin >> a[i][j];
		}
	}
	int h[n][n];
	int v[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			h[i][j] = 0;
			v[i][j] = 0;
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[i][j]=='.'){
			while(j<n&&a[i][j]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				h[i][k] = count;
			}
		 }
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[j][i]=='.'){
			while(j<n&&a[j][i]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				v[k][i] = count;
			}
		 }
		}
	}
	int ans1 = 0;
	int ans2 = 0;
	int ans = 0;
	FOR(i,n,0){
		FOR(j,n,0){
			if(h[i][j]-k+1 + v[i][j]-k + 1 > ans){
				ans = h[i][j]-k+1 + v[i][j]-k + 1;
				ans1 = i;
				ans2 = j;
			}
		}
	}
	cout << ans1+1 << " " << ans2+1;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define MOD 1000000007
#define N 100010

#define scd(x) scanf("%d",&x);
#define prd(x) printf("%d\n",x);
#define scl(x) scanf("%lld",&x);
#define prl(x) printf("%lld",x);

#define FOR(i,k,e) for (int i=e ; i<k ; i++)
#define RFOR(i,k,e) for (int i=e ; i>=k ; i--)

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector< pii > vpi;
typedef vector< pll > vpl;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	// int k,n,s,p;
	// cin >> k >> n >> s >> p;
	// int ans = ceil((double)n/s);
	// int temp = ans*k;
	// cout << ceil((double)temp/p);
	int n,k;
	cin >> n >> k;
	int res  = k;
	char a[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			cin >> a[i][j];
		}
	}
	int h[n][n];
	int v[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			h[i][j] = 0;
			v[i][j] = 0;
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[i][j]=='.'){
			while(j<n&&a[i][j]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				h[i][k] =max(0,min(res-1,k - temp) + min (count-(k+1-temp) ,res-1)+ 2-res);
			}
		 }
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[j][i]=='.'){
			while(j<n&&a[j][i]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				v[k][i] = max(0,min(res-1,k - temp) + min (count-(k+1-temp) ,res-1)+ 2-res);
			}
		 }
		}
	}
	// FOR(i,n,0){
	// 	FOR(j,n,0){
	// 		cout << h[i][j] << " ";
	// 	}
	// 	cout << "\n";
	// }
	int ans1 = 0;
	int ans2 = 0;
	int ans = 0;
	FOR(i,n,0){
		FOR(j,n,0){
			int temp = 0;

			if(h[i][j]>=res){temp = temp + max(0,h[i][j]);}
			if(v[i][j]>=res){temp = temp + max(0,v[i][j]);}

			if( temp  > ans){
				ans = temp;
				ans1 = i;
				ans2 = j;
			}
		}
	}

	cout << ans1+1 << " " << ans2+1;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define MOD 1000000007
#define N 100010

#define scd(x) scanf("%d",&x);
#define prd(x) printf("%d\n",x);
#define scl(x) scanf("%lld",&x);
#define prl(x) printf("%lld",x);

#define FOR(i,k,e) for (int i=e ; i<k ; i++)
#define RFOR(i,k,e) for (int i=e ; i>=k ; i--)

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector< pii > vpi;
typedef vector< pll > vpl;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	// int k,n,s,p;
	// cin >> k >> n >> s >> p;
	// int ans = ceil((double)n/s);
	// int temp = ans*k;
	// cout << ceil((double)temp/p);
	int n,k;
	cin >> n >> k;
	int res  = k;
	char a[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			cin >> a[i][j];
		}
	}
	int h[n][n];
	int v[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			h[i][j] = 0;
			v[i][j] = 0;
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[i][j]=='.'){
			while(j<n&&a[i][j]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				h[i][k] =max(0,min(res-1,k - temp) + min (count-(k+1-temp) ,res-1)+ 2-res);
			}
		 }
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[j][i]=='.'){
			while(j<n&&a[j][i]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				v[k][i] = max(0,min(res-1,k - temp) + min (count-(k+1-temp) ,res-1)+ 2-res);
			}
		 }
		}
	}
	// FOR(i,n,0){
	// 	FOR(j,n,0){
	// 		cout << h[i][j] << " ";
	// 	}
	// 	cout << "\n";
	// }
	int ans1 = 0;
	int ans2 = 0;
	int ans = 0;
	FOR(i,n,0){
		FOR(j,n,0){
			int temp = 0;

			if( h[i][j]+v[i][j]  > ans){
				ans = h[i][j]+v[i][j];
				ans1 = i;
				ans2 = j;
			}
		}
	}

	cout << ans1+1 << " " << ans2+1;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define MOD 1000000007
#define N 100010

#define scd(x) scanf("%d",&x);
#define prd(x) printf("%d\n",x);
#define scl(x) scanf("%lld",&x);
#define prl(x) printf("%lld",x);

#define FOR(i,k,e) for (int i=e ; i<k ; i++)
#define RFOR(i,k,e) for (int i=e ; i>=k ; i--)

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector< pii > vpi;
typedef vector< pll > vpl;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	// int k,n,s,p;
	// cin >> k >> n >> s >> p;
	// int ans = ceil((double)n/s);
	// int temp = ans*k;
	// cout << ceil((double)temp/p);
	int n,k;
	cin >> n >> k;
	int res  = k;
	char a[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			cin >> a[i][j];
		}
	}
	int h[n][n];
	int v[n][n];
	FOR(i,n,0){
		FOR(j,n,0){
			h[i][j] = 0;
			v[i][j] = 0;
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[i][j]=='.'){
			while(j<n&&a[i][j]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				h[i][k] =min(res-1,k - temp) + min (count-(k+1) ,res-1)+ 1;
			}
		 }
		}
	}
	FOR(i,n,0){
		FOR(j,n,0){
			int count = 0;
			int temp = j;
			if(a[j][i]=='.'){
			while(j<n&&a[j][i]=='.'){
				count++;
				j++;
			}
			FOR(k,j,temp){
				v[k][i] = min(res-1,k - temp) + min (count-(k+1) ,res-1)+ 1;
			}
		 }
		}
	}
	// FOR(i,n,0){
	// 	FOR(j,n,0){
	// 		cout << v[i][j] << " ";
	// 	}
	// 	cout << "\n";
	// }
	int ans1 = 0;
	int ans2 = 0;
	int ans = 0;
	FOR(i,n,0){
		FOR(j,n,0){
			int temp = 0;

			if(h[i][j]>=res){temp = temp + max(0,h[i][j]-res+1);}
			if(v[i][j]>=res){temp = temp + max(0,v[i][j]-res+1);}

			if( temp  > ans){
				ans = temp;
				ans1 = i;
				ans2 = j;
			}
		}
	}

	cout << ans1+1 << " " << ans2+1;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define me boss
#define ll long long int
char A[101][101];
int vis[1001][1001],cn[1001][1001];
int main()
{
    int n,k,cnt=0,f=0;
    cin>>n>>k;
    for(int i=1; i<=n; i++)
    {
        for(int j=1; j<=n; j++)
        {
            cin>>A[i][j];
        }
    }
    for(int i=1; i<=n; i++)
    {
        for(int j=1; j<=n; j++)
        {
            if(A[i][j]=='.'&&vis[i][j]==0)
            {
                //cout<<"IN"<<" "<<i<<" "<<j<<" "<<cnt<<endl;
                for(int p=j; p>0; p--)
                {
                    if(A[i][p]=='.')
                        cnt++;
                        else
                            break;
                    if(cnt==k)
                    {
                        for(int p=j; p>j-k; p--)
                        {
                            //cout<<i<<" "<<p<<endl;
                            vis[i][p]=1,cn[i][p]++;
                        }
                        break;
                    }
                }
                cnt=0;
                if(vis[i][j]==0)
                     for(int p=i; p>0; p--)
                {
                    if(A[p][j]=='.')
                        cnt++;
                        else
                            break;
                    if(cnt==k)
                    {
                        for(int p=i; p>i-k; p--)
                        {
                            //cout<<p<<" "<<j<<endl;
                            vis[p][j]=1,cn[p][j]++;
                        }
                        break;
                    }
                }
                cnt=0;
                if(vis[i][j]==0)
                for(int p=i; p<=n; p++)
                {
                    if(A[p][j]=='.')
                        cnt++;
                        else
                            break;
                    if(cnt==k)
                    {
                        for(int p=i; p<i+k; p++)
                        {
                            //cout<<p<<" "<<j<<endl;
                            vis[p][j]=1,cn[p][j]++;
                        }
                        break;
                    }
                }
                cnt=0;
                if(vis[i][j]==0)
                for(int p=j; p<=n; p++)
                {
                    if(A[i][p]=='.')
                        cnt++;
                        else
                            break;
                    if(cnt==k)
                    {
                        for(int p=j; p<j+k; p++)
                        {
                            //cout<<i<<" "<<p<<endl;
                            vis[i][p]=1,cn[i][p]++;
                        }
                        break;
                    }
                }
                cnt=0;
            }
        }
    }
    int ans=-1,x,y;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            //cout<<cn[i][j];
            if(ans<=cn[i][j])
            {
                ans=cn[i][j];
                x=i,y=j;
            }
        }
        //cout<<endl;
    }
    if(ans==-1)
        cout<<1<<" "<<1<<endl;
    else
        cout<<x<<" "<<y<<endl;
    //cout<<ans<<" "<<x<<" "<<y<<endl;
    return 0;
}


#include <cstdio>
#define MAX 101
int n,k,grid[MAX][MAX];

int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j){
			char tmp;
			scanf(" %c",&tmp);
			if (tmp=='#') grid[i][j]=-1;
		}
	}
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j){
			if (n-i+1>=k){
				bool flag=true;
				for (int t=0;t<k;++t){
					if (grid[i+t][j]==-1){
						flag=false;
						break;
					}
				}
				if (flag) for (int t=0;t<k;++t) grid[i+t][j]++;
			}
			if (n-j+1>=k){
				bool flag=true;
				for (int t=0;t<k;++t){
					if (grid[i][j+t]==-1){
						flag=false;
						break;
					}
				}
				if (flag) for (int t=0;t<k;++t) grid[i][j+t]++;
			}
		}
	}
	int max=-1,r,c;
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j){
			if (grid[i][j]>max) max=grid[i][j],r=i,c=j;
		}
	}
	printf("%d %d\n",r,c);
	return 0;
}


#include <cstdio>
#define MAX 101
int n,k,grid[MAX][MAX];

int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j){
			char tmp;
			scanf(" %c",&tmp);
			if (tmp=='#') grid[i][j]=-1;
		}
	}
	for (int i=1;i<=n-k+1;++i){
		for (int j=1;j<=n-k+1;++j){
			bool flag=true;
			for (int t=0;t<k;++t){
				if (grid[i+t][j]==-1){
					flag=false;
					break;
				}
			}
			if (flag) for (int t=0;t<k;++t) grid[i+t][j]++;
			flag=true;
			for (int t=0;t<k;++t){
				if (grid[i][j+t]==-1){
					flag=false;
					break;
				}
			}
			if (flag) for (int t=0;t<k;++t) grid[i][j+t]++;
		}
	}
	int max=-1,r,c;
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j){
			if (grid[i][j]>max) max=grid[i][j],r=i,c=j;
		}
	}
	printf("%d %d\n",r,c);
	return 0;
}


#include <cstdio>
#define MAX 101
int n,k,grid[MAX][MAX];

int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j){
			char tmp;
			scanf(" %c",&tmp);
			if (tmp=='#') grid[i][j]=-1;
		}
	}
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j){
			if (n-i+1>=k){
				bool flag=true;
				for (int t=0;t<k;++t){
					if (grid[i+t][j]==-1){
						flag=false;
						break;
					}
				}
				if (flag) for (int t=0;t<k;++t) grid[i+t][j]++;
			}
			if (n-j+1>=k){
				bool flag=true;
				for (int t=0;t<k;++t){
					if (grid[i][j+t]==-1){
						flag=false;
						break;
					}
				}
				if (flag) for (int t=0;t<k;++t) grid[i][j+t]++;
			}
		}
	}
	int max=-1,r=1,c=1;
	for (int i=1;i<=n;++i){
		for (int j=1;j<=n;++j){
			if (grid[i][j]>max) max=grid[i][j],r=i,c=j;
		}
	}
	printf("%d %d\n",r,c);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>

using namespace std;

int grid[100][100];
int nr[100][100];
int nl[100][100];
int nu[100][100];
int nd[100][100];

int main() {
    cout.setf(ios::fixed, ios::floatfield);
    cout.setf(ios::showpoint);
    cout.precision(12);
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    int n, k;
    cin >> n >> k;

    string s;
    for(int i = 0; i < n; ++i) {
        cin >> s;
        for(int j = 0; j < n; ++j) {
            if(s[j] == '#') grid[i][j] = 1;
            else grid[i][j] = 0;
        }
    }

    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            if(grid[i][j] == 1) continue;

            if(j == 0) {
                nl[i][j] = -1;
            } else {
                nl[i][j] = grid[i][j - 1] == 1 ? j - 1 : nl[i][j - 1];
            }
        }

        for(int j = n - 1; j >= 0; --j) {
            if(grid[i][j] == 1) continue;

            if(j == n - 1) {
                nr[i][j] = n;
            } else {
                nr[i][j] = grid[i][j + 1] == 1 ? j + 1 : nr[i][j + 1];
            }
        }
    }

    for(int j = 0; j < n; ++j) {
        for(int i = 0; i < n; ++i) {
            if(grid[i][j] == 1) continue;

            if(i == 0) {
                nu[i][j] = -1;
            } else {
                nu[i][j] = grid[i - 1][j] == 1 ? i - 1 : nu[i - 1][j];
            }
        }

        for(int i = n - 1; i >= 0; --i) {
            if(grid[i][j] == 1) continue;

            if(i == n - 1) {
                nd[i][j] = n;
            } else {
                nd[i][j] = grid[i + 1][j] == 1 ? i + 1 : nd[i + 1][j];
            }
        }
    }

    /*
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            cout << "i = " << i << ", j = " << j << endl;
            int left = nl[i][j];
            int right = nr[i][j];
            int up = nu[i][j];
            int down = nd[i][j];
            cout << "\tleft = " << left << ", right = " << right << endl;
            cout << "\tdown = " << down << ", up = " << up << endl;
        }
    }
    */

    int tot_best = -1;
    int best_i = -1;
    int best_j = -1;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            if(grid[i][j] == 1) continue;

            // cout << "i = " << i << ", j = " << j << endl;
            int best = 0;
            int left = j - nl[i][j] - 1;
            int right = nr[i][j] - j - 1;
            int td = left + right + 1;
            // cout << "\tleft = " << left << ", right = " << right << endl;
            td = td > 2 * k - 1 ? 2 * k - 1 : td;
            if(td >= k) {
                best += td - (k - 1);
            }

            int down = nd[i][j] - i - 1;
            int up =  i - nu[i][j] - 1;
            td = down + up + 1;
            // cout << "\tdown = " << down << ", up = " << up << endl;
            td = td > 2 * k - 1 ? 2 * k - 1 : td;
            if(td >= k) {
                best += td - (k - 1);
            }
            if(best > tot_best) {
                best_i = i;
                best_j = j;
                tot_best = best;
            }
        }
    }

    cout << best_i + 1 << " " << best_j + 1 << endl;

    return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>

using namespace std;

int grid[100][100];
int nr[100][100];
int nl[100][100];
int nu[100][100];
int nd[100][100];

int main() {
    cout.setf(ios::fixed, ios::floatfield);
    cout.setf(ios::showpoint);
    cout.precision(12);
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    int n, k;
    cin >> n >> k;

    string s;
    for(int i = 0; i < n; ++i) {
        cin >> s;
        for(int j = 0; j < n; ++j) {
            if(s[j] == '#') grid[i][j] = 1;
            else grid[i][j] = 0;
        }
    }

    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            if(grid[i][j] == 1) continue;

            if(j == 0) {
                nl[i][j] = -1;
            } else {
                nl[i][j] = grid[i][j - 1] == 1 ? j - 1 : nl[i][j - 1];
            }
        }

        for(int j = n - 1; j >= 0; --j) {
            if(grid[i][j] == 1) continue;

            if(j == n - 1) {
                nr[i][j] = n;
            } else {
                nr[i][j] = grid[i][j + 1] == 1 ? j + 1 : nr[i][j + 1];
            }
        }
    }

    for(int j = 0; j < n; ++j) {
        for(int i = 0; i < n; ++i) {
            if(grid[i][j] == 1) continue;

            if(i == 0) {
                nu[i][j] = -1;
            } else {
                nu[i][j] = grid[i - 1][j] == 1 ? i - 1 : nu[i - 1][j];
            }
        }

        for(int i = n - 1; i >= 0; --i) {
            if(grid[i][j] == 1) continue;

            if(i == n - 1) {
                nd[i][j] = n;
            } else {
                nd[i][j] = grid[i + 1][j] == 1 ? i + 1 : nd[i + 1][j];
            }
        }
    }

    /*
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            cout << "i = " << i << ", j = " << j << endl;
            int left = nl[i][j];
            int right = nr[i][j];
            int up = nu[i][j];
            int down = nd[i][j];
            cout << "\tleft = " << left << ", right = " << right << endl;
            cout << "\tdown = " << down << ", up = " << up << endl;
        }
    }
    */

    int tot_best = -1;
    int best_i = 1;
    int best_j = 1;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            if(grid[i][j] == 1) continue;

            int best = 0;
            int left = j - nl[i][j] - 1;
            left = min(left, k - 1);
            int right = nr[i][j] - j - 1;
            right = min(right, k - 1);
            int td = left + right + 1;
            // cout << "\tleft = " << left << ", right = " << right << endl;
            td = td > 2 * k - 1 ? 2 * k - 1 : td;
            if(td >= k) {
                best += td - (k - 1);
            }

            int down = nd[i][j] - i - 1;
            down = min(down, k - 1);
            int up =  i - nu[i][j] - 1;
            up = min(up, k - 1);
            td = down + up + 1;
            // cout << "\tdown = " << down << ", up = " << up << endl;
            td = td > 2 * k - 1 ? 2 * k - 1 : td;
            if(td >= k) {
                best += td - (k - 1);
            }
            // cout << "i = " << i << ", j = " << j << ", best = " << best << endl;
            if(best > tot_best) {
                best_i = i + 1;
                best_j = j + 1;
                tot_best = best;
            }
        }
    }

    cout << best_i << " " << best_j << endl;

    return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>

using namespace std;

int grid[100][100];
int nr[100][100];
int nl[100][100];
int nu[100][100];
int nd[100][100];

int main() {
    cout.setf(ios::fixed, ios::floatfield);
    cout.setf(ios::showpoint);
    cout.precision(12);
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    int n, k;
    cin >> n >> k;

    string s;
    for(int i = 0; i < n; ++i) {
        cin >> s;
        for(int j = 0; j < n; ++j) {
            if(s[j] == '#') grid[i][j] = 1;
            else grid[i][j] = 0;
        }
    }

    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            if(grid[i][j] == 1) continue;

            if(j == 0) {
                nl[i][j] = -1;
            } else {
                nl[i][j] = grid[i][j - 1] == 1 ? j - 1 : nl[i][j - 1];
            }
        }

        for(int j = n - 1; j >= 0; --j) {
            if(grid[i][j] == 1) continue;

            if(j == n - 1) {
                nr[i][j] = n;
            } else {
                nr[i][j] = grid[i][j + 1] == 1 ? j + 1 : nr[i][j + 1];
            }
        }
    }

    for(int j = 0; j < n; ++j) {
        for(int i = 0; i < n; ++i) {
            if(grid[i][j] == 1) continue;

            if(i == 0) {
                nu[i][j] = -1;
            } else {
                nu[i][j] = grid[i - 1][j] == 1 ? i - 1 : nu[i - 1][j];
            }
        }

        for(int i = n - 1; i >= 0; --i) {
            if(grid[i][j] == 1) continue;

            if(i == n - 1) {
                nd[i][j] = n;
            } else {
                nd[i][j] = grid[i + 1][j] == 1 ? i + 1 : nd[i + 1][j];
            }
        }
    }

    /*
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            cout << "i = " << i << ", j = " << j << endl;
            int left = nl[i][j];
            int right = nr[i][j];
            int up = nu[i][j];
            int down = nd[i][j];
            cout << "\tleft = " << left << ", right = " << right << endl;
            cout << "\tdown = " << down << ", up = " << up << endl;
        }
    }
    */

    int tot_best = -1;
    int best_i = 1;
    int best_j = 1;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            if(grid[i][j] == 1) continue;

            // cout << "i = " << i << ", j = " << j << endl;
            int best = 0;
            int left = j - nl[i][j] - 1;
            int right = nr[i][j] - j - 1;
            int td = left + right + 1;
            // cout << "\tleft = " << left << ", right = " << right << endl;
            td = td > 2 * k - 1 ? 2 * k - 1 : td;
            if(td >= k) {
                best += td - (k - 1);
            }

            int down = nd[i][j] - i - 1;
            int up =  i - nu[i][j] - 1;
            td = down + up + 1;
            // cout << "\tdown = " << down << ", up = " << up << endl;
            td = td > 2 * k - 1 ? 2 * k - 1 : td;
            if(td >= k) {
                best += td - (k - 1);
            }
            if(best > tot_best) {
                best_i = i + 1;
                best_j = j + 1;
                tot_best = best;
            }
        }
    }

    cout << best_i << " " << best_j << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
#define LL long long
#define INF 0x3f3f3f3f

const int MAXN = 1e2 + 5;
const LL MOD = 1e9 + 7;

char mp[MAXN][MAXN];
int num[MAXN][MAXN];
int lr = 1;
int ll = 1;
int maxx = 0;
int n, len;
int step[4][2] = {{1, 0}, { -1, 0}, {0, 1}, { -1, 0}};

void dfs(int r, int l, int k)
{
    int zr = r + step[k][0] * (len - 1);
    int zl = l + step[k][1] * (len - 1);
    if(zr < 0 || zr >= n || zl < 0 || zl >= n)
        return;
    int i = r, j = l;
    while(1)
    {
        if(mp[i][j] == '#')
            return ;
        if(i == zr && j == zl)
            break;
        i += step[k][0];
        j += step[k][1];
    }
    i = r, j = l;
    while(1)
    {
        num[i][j]++;
        maxx = max(num[i][j], maxx);
        if(i == zr && j == zl)
            break;
        i += step[k][0];
        j += step[k][1];
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
#endif

    cin >> n >> len;
    getchar();
    for(int i = 0; i < n; i++)
        gets(mp[i]);
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            for(int k = 0; k < 4; k++)
                dfs(i, j, k);
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            if(num[i][j] == maxx)
                lr = i + 1,ll = j + 1;
    printf("%d %d\n", lr, ll);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
#define LL long long
#define INF 0x3f3f3f3f

const int MAXN = 1e2 + 5;
const LL MOD = 1e9 + 7;

char mp[MAXN][MAXN];
int num[MAXN][MAXN];
int lr = 1;
int ll = 1;
int maxx = 0;
int n, len;
int step[4][2] = {{1, 0}, { -1, 0}, {0, 1}, { 0, -1}};

void dfs(int r, int l, int k)
{
    int zr = r + step[k][0] * (len - 1);
    int zl = l + step[k][1] * (len - 1);
    if(zr < 0 || zr >= n || zl < 0 || zl >= n)
        return;
    int i = r, j = l;
    while(1)
    {
        if(mp[i][j] == '#')
            return ;
        if(i == zr && j == zl)
            break;
        i += step[k][0];
        j += step[k][1];
    }
    i = r, j = l;
    while(1)
    {
        num[i][j]++;
        maxx = max(num[i][j], maxx);
        if(i == zr && j == zl)
            break;
        i += step[k][0];
        j += step[k][1];
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
#endif

    cin >> n >> len;
    getchar();
    for(int i = 0; i < n; i++)
        gets(mp[i]);
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            for(int k = 0; k < 4; k++)
                dfs(i, j, k);
    // for (int i = 0; i < n; ++i)
    // {
    //     for (int j = 0; j < n; ++j)
    //     {
    //         printf("%d ", num[i][j]);
    //     }
    //     printf("\n");
    // }
    // cout << maxx << endl;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            if(num[i][j] == maxx)
                lr = i + 1,ll = j + 1;
    printf("%d %d\n", lr, ll);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
#define LL long long
#define INF 0x3f3f3f3f

const int MAXN = 1e2 + 5;
const LL MOD = 1e9+7;

char mp[MAXN][MAXN];
int lr = 1;
int ll = 1;

int main()
{
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
#endif

    int n, len;
    cin >> n >> len;
    getchar();
    for(int i = 0; i < n; i++)
        gets(mp[i]);
    for(int i = 0; i < n; i++)
    {
        int sum = 0;
        for(int j = 0; j < n; j++)
        {
            if(mp[i][j] == '.')
            {
                sum++;
                if(sum >= len)
                {
                    lr = i+1;
                    ll = j+1;
                }
            }
            else
                sum = 0;
        }
    }
    for(int i = 0; i < n; i++)
    {
        int sum = 0;
        for(int j = 0; j < n; j++)
        {
            if(mp[j][i] == '.')
            {
                sum++;
                if(sum >= len)
                {
                    lr = j+1;
                    ll = i+1;
                }
            }
            else
                sum = 0;
        }
    }
    printf("%d %d\n", lr, ll);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
#define LL long long
#define INF 0x3f3f3f3f

const int MAXN = 1e2 + 5;
const LL MOD = 1e9+7;

char mp[MAXN][MAXN];
int lr = 1;
int ll = 1;
int maxx = 0;
int n, len;
bool check(int r, int l)
{
    int sum = 0;
    if(mp[r][l] == '#')
        return 0;
    for(int i = 1; i < len; i++)
    {
        if(l+i >= n)
            break;
        if(mp[r][l+i] == '#')
            break;
        if(mp[r][l+i] == '.' && i == len-1)
            sum++;
    }
    for(int i = 1; i < len; i++)
    {
        if(l-i < 0)
            break;
        if(mp[r][l-i] == '#')
            break;
        if(mp[r][l-i] == '.' && i == len-1)
            sum++;
    }
    for(int i = 1; i < len; i++)
    {
        if(r+i >= n)
            break;
        if(mp[r+i][l] == '#')
            break;
        if(mp[r+i][l] == '.' && i == len-1)
            sum++;
    }
    for(int i = 1; i < len; i++)
    {
        if(r-i < 0)
            break;
        if(mp[r-i][l] == '#')
            break;
        if(mp[r-i][l] == '.' && i == len-1)
            sum++;
    }
    if(sum > maxx)
    {
        maxx = sum;
        return 1;
    }
    return 0;
}

int main()
{
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
#endif

    cin >> n >> len;
    getchar();
    for(int i = 0; i < n; i++)
        gets(mp[i]);
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            if(check(i, j))
            {
                lr = i+1;
                ll = j+1;
            }
        }
    }
    printf("%d %d\n", lr, ll);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
#define LL long long
#define INF 0x3f3f3f3f

const int MAXN = 1e2 + 5;
const LL MOD = 1e9+7;

char mp[MAXN][MAXN];
int lr = 1;
int ll = 1;

int main()
{
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
#endif

    int n, len;
    cin >> n >> len;
    getchar();
    for(int i = 0; i < n; i++)
        gets(mp[i]);
    for(int i = 0; i < n; i++)
    {
        int sum = 0;
        for(int j = 0; j < n; j++)
        {
            if(mp[i][j] == '.')
            {
                sum++;
                if(sum >= len)
                {
                    lr = i+1;
                    ll = j+1;
                }
            }
        }
    }
    for(int i = 0; i < n; i++)
    {
        int sum = 0;
        for(int j = 0; j < n; j++)
        {
            if(mp[j][i] == '.')
            {
                sum++;
                if(sum >= len)
                {
                    lr = j+1;
                    ll = i+1;
                }
            }
        }
    }
    printf("%d %d\n", lr, ll);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
#define LL long long
#define INF 0x3f3f3f3f

const int MAXN = 1e2 + 5;
const LL MOD = 1e9+7;

char mp[MAXN][MAXN];
int lr = 1;
int ll = 1;
int maxx = 0;
int n, len;
int step[4][2] = {{1,0},{-1,0},{0,1},{-1,0}};
bool check(int r, int l)
{
    int sum = 0;
    if(mp[r][l] == '#')
        return 0;
    if(len == 1)
        return 1;
    for(int i = 1; i < len; i++)
    {
        if(l+i >= n)
            break;
        if(mp[r][l+i] == '#')
            break;
        if(mp[r][l+i] == '.' && i == len-1)
            sum++;
    }
    for(int i = 1; i < len; i++)
    {
        if(l-i < 0)
            break;
        if(mp[r][l-i] == '#')
            break;
        if(mp[r][l-i] == '.' && i == len-1)
            sum++;
    }
    for(int i = 1; i < len; i++)
    {
        if(r+i >= n)
            break;
        if(mp[r+i][l] == '#')
            break;
        if(mp[r+i][l] == '.' && i == len-1)
            sum++;
    }
    for(int i = 1; i < len; i++)
    {
        if(r-i < 0)
            break;
        if(mp[r-i][l] == '#')
            break;
        if(mp[r-i][l] == '.' && i == len-1)
            sum++;
    }
    if(sum > maxx)
    {
        maxx = sum;
        return 1;
    }
    return 0;
}

int main()
{
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
#endif

    cin >> n >> len;
    getchar();
    for(int i = 0; i < n; i++)
        gets(mp[i]);
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            if(check(i, j))
            {
                lr = i+1;
                ll = j+1;
            }
        }
    }
    printf("%d %d\n", lr, ll);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int main()
{
    int t;
    t = 1;
    while(t--)
    {
        int n, k, i, j, l;
        cin >> n >> k;
        string mat[n];
        for(i = 0; i < n; i++)
        {
            cin >> mat[i];
        }
        int x=0,y=0,ans=0,cnt=0;
        for(i=0;i<n;i++)
        {
            for(j=0;j<n;j++)
            {
                if(mat[i][j]=='.')
                {
                    cnt=0;
                    for(l = j; l>=0;l--)
                    {
                        if(mat[i][l]!='.')
                            break;
                    }
                    int s = l + 1;
                    for(l=j;l<n;l++)
                    {
                        if(mat[i][l]!='.')
                            break;
                    }
                    int e = l-1;
                    if(e-s+1>=k)
                    {
                        cnt+=min(k-1,min(j-s,e-j))+1;

                    }
                    for(l=i;l>=0;l--)
                    {
                        if(mat[l][j]!='.')
                            break;
                    }
                    s=l+1;
                    for(l=i;l<n;l++)
                    {
                        if(mat[l][j]!='.')
                            break;
                    }
                    e=l-1;
                    if(e-s+1>=k)
                    {
                        cnt+=min(k-1,min(i-s,e-i))+1;
                        if(ans<cnt)
                        {
                            ans=cnt;
                            x=i;
                            y=j;
                        }

                    }
                    cout<< i <<" " << j<< " "<<cnt<<endl;

                }
            }
        }
        cout<<cnt<<endl;
        cout<<x+1<<" "<<y+1<<endl;

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int main()
{
    int t;
    t = 1;
    while(t--)
    {
        int n, k, i, j, l;
        cin >> n >> k;
        string mat[n];
        for(i = 0; i < n; i++)
        {
            cin >> mat[i];
        }
        int x=0,y=0,ans=0,cnt=0;
        for(i=0;i<n;i++)
        {
            for(j=0;j<n;j++)
            {
                if(mat[i][j]=='.')
                {
                    cnt=0;
                    for(l = j; l>=0;l--)
                    {
                        if(mat[i][l]!='.')
                            break;
                    }
                    int s = l + 1;
                    for(l=j;l<n;l++)
                    {
                        if(mat[i][l]!='.')
                            break;
                    }
                    int e = l-1;
                    if(e-s+1>=k)
                    {
                        cnt+=min(k-1,min(j-s,e-j))+1;

                    }
                    for(l=i;l>=0;l--)
                    {
                        if(mat[l][j]!='.')
                            break;
                    }
                    s=l+1;
                    for(l=i;l<n;l++)
                    {
                        if(mat[l][j]!='.')
                            break;
                    }
                    e=l-1;
                    if(e-s+1>=k)
                    {
                        cnt+=min(k-1,min(i-s,e-i))+1;
                        if(ans<cnt)
                        {
                            ans=cnt;
                            x=i;
                            y=j;
                        }

                    }

                }
            }
        }
        cout<<x+1<<" "<<y+1<<endl;

    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
	char map[200][200];
	int cnt[200][200];
	int n,k;
	cin>>n>>k;
	for(int i=0;i<200;i++){
		for(int j=0;j<200;j++){
			map[i][j]='#';
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			cin>>map[i][j];
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n-k+1;j++){
			bool fill=true;
			for(int t=0;t<k;t++){
				if(map[i][j+t]=='#'){
					fill=false;
					j+=t+1;
					break;
				}
			}
			if(fill==true){
				for(int t=0;t<k;t++){
					cnt[i][j+t]++;
				}
			}
		}
	}
	for(int j=0;j<n;j++){
		for(int i=0;i<n-k+1;i++){
			bool fill=true;
			for(int t=0;t<k;t++){
				if(map[i+t][j]=='#'){
					fill=false;
					i+=t+1;
					break;
				}
			}
			if(fill==true){
				for(int t=0;t<k;t++){
					cnt[i+t][j]++;
				}
			}
		}
	}
	int mi,mj;
	int max=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(cnt[i][j]>max){
				max=cnt[i][j];
				mi=i;
				mj=j;
			}
		}
	}
	cout<<mi+1<<" "<<mj+1<<endl;

	return 0;
}


#include<iostream>
using namespace std;
int main(){
	char map[100][100];
	int cnt[100][100];
	int n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			cin>>map[i][j];
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n-k+1;j++){
			bool fill=true;
			for(int t=0;t<k;t++){
				if(map[i][j+t]=='#'){
					fill=false;
					j+=t+1;
					break;
				}
			}
			if(fill==true){
				for(int t=0;t<k;t++){
					cnt[i][j+t]++;
				}
			}
		}
	}
	for(int j=0;j<n;j++){
		for(int i=0;i<n-k+1;i++){
			bool fill=true;
			for(int t=0;t<k;t++){
				if(map[i+t][j]=='#'){
					fill=false;
					i+=t+1;
					break;
				}
			}
			if(fill==true){
				for(int t=0;t<k;t++){
					cnt[i+t][j]++;
				}
			}
		}
	}
	int mi,mj;
	int max=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(cnt[i][j]>max){
				max=cnt[i][j];
				mi=i;
				mj=j;
			}
		}
	}
	cout<<mi+1<<" "<<mj+1<<endl;

	return 0;
}


#include<iostream>
using namespace std;
int main(){
	char map[200][200];
	int cnt[200][200];
	int n,k;
	cin>>n>>k;
	for(int i=0;i<200;i++){
		for(int j=0;j<200;j++){
			map[i][j]='#';
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			cin>>map[i][j];
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			bool fill=true;
			for(int t=0;t<k;t++){
				if(map[i][j+t]=='#'){
					fill=false;
				}
			}
			if(fill==true){
				for(int t=0;t<k;t++){
					cnt[i][j+t]++;
				}
			}
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			bool fill=true;
			for(int t=0;t<k;t++){
				if(map[i+t][j]=='#'){
					fill=false;
				}
			}
			if(fill==true){
				for(int t=0;t<k;t++){
					cnt[i+t][j]++;
				}
			}
		}
	}
	int mi,mj;
	int max=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(cnt[i][j]>max){
				max=cnt[i][j];
				mi=i;
				mj=j;
			}
		}
	}
	cout<<mi+1<<" "<<mj+1<<endl;

	return 0;
}


#include<iostream>
using namespace std;
int main(){
	char map[100][100];
	int cnt[100][100];
	int n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			cin>>map[i][j];
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n-k+1;j++){
			bool fill=true;
			for(int t=0;t<k;t++){
				if(map[i][j+t]=='#'){
					fill=false;
					j+=t;
					break;
				}
			}
			if(fill==true){
				for(int t=0;t<k;t++){
					cnt[i][j+t]++;
				}
			}
		}
	}
	for(int j=0;j<n;j++){
		for(int i=0;i<n-k+1;i++){
			bool fill=true;
			for(int t=0;t<k;t++){
				if(map[i+t][j]=='#'){
					fill=false;
					i+=t;
					break;
				}
			}
			if(fill==true){
				for(int t=0;t<k;t++){
					cnt[i+t][j]++;
				}
			}
		}
	}
	int mi,mj;
	int max=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(cnt[i][j]>max){
				max=cnt[i][j];
				mi=i;
				mj=j;
			}
		}
	}
	cout<<mi+1<<" "<<mj+1<<endl;

	return 0;
}


#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string.h>
#define ll long long
#define maxn 200005
using namespace std;
char mz[105][105];
int vis[105][105]={0};
int main()
{
    int n,k;
    cin>>n>>k;
    getchar();
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
            scanf("%c",&mz[i][j]);
        getchar();
    }

    int ansx=0,ansy=0,ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            int heng=0,shu=0;
            for(int z=0;z<k;z++)
            {
                if(mz[i][j+z]=='.'&&j+z<n)
                    heng++;
                if(mz[i+z][j]=='.'&&i+z<n)
                    shu++;
            }
            if(heng==k)
                for(int z=0;z<k;z++)
                {
                    vis[i][j+z]++;
                    if(vis[i][j+z]>ans)
                    {
                        ans=vis[i][j+z];
                        ansx=i+1;
                        ansy=j+z+1;
                    }
                }
            if(shu==k)
                for(int z=0;z<k;z++)
                {
                    vis[i+z][j]++;
                    if(vis[i+z][j]>ans)
                    {
                        ans=vis[i+z][j];
                        ansx=i+z+1;
                        ansy=j+1;
                    }
                }
        }
    }
    cout<<ansx<<" "<<ansy<<endl;
}


#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string.h>
#define ll long long
#define maxn 200005
using namespace std;
char mz[105][105];
int vis[105][105]={0};
int main()
{
    int n,k;
    cin>>n>>k;
    getchar();
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
            scanf("%c",&mz[i][j]);
        getchar();
    }

    int ansx=1,ansy=1,ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            int heng=0,shu=0;
            for(int z=0;z<k;z++)
            {
                if(mz[i][j+z]=='.'&&j+z<n)
                    heng++;
                if(mz[i+z][j]=='.'&&i+z<n)
                    shu++;
            }
            if(heng==k)
                for(int z=0;z<k;z++)
                {
                    vis[i][j+z]++;
                    if(vis[i][j+z]>ans)
                    {
                        ans=vis[i][j+z];
                        ansx=i+1;
                        ansy=j+z+1;
                    }
                }
            if(shu==k)
                for(int z=0;z<k;z++)
                {
                    vis[i+z][j]++;
                    if(vis[i+z][j]>ans)
                    {
                        ans=vis[i+z][j];
                        ansx=i+z+1;
                        ansy=j+1;
                    }
                }
        }
    }
    cout<<ansx<<" "<<ansy<<endl;
}


#include<bits/stdc++.h>
#define timesaver ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
    timesaver;
    int n,k;
    cin>>n>>k;
    char grid[n][n];
    int hash[n][n];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
            hash[i][j]=0;
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)

            cin>>grid[i][j];
    }

    int count=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(grid[i][j]=='.')
                count++;
            if(grid[i][j]=='#' || j==n-1)
            {
              if(count>=k)
              {
                  int start,end;

                  if(grid[i][j]=='#')
                       start=j-count;
                  else if(j==n-1)
                       start=j-count+1;
                   end=start+count-1;
                //   cout<<i<<" "<<start<<" "<<place<<endl;
                  for(int m=start;m<=end-k+1;m++)
                  {
                      for(int s=m;s<=m+k-1;s++)
                          hash[i][s]++;
                  }
              }

              count=0;
          }
      }
   }

     count=0;
    for(int j=0;j<n;j++)
    {
        for(int i=0;i<n;i++)
        {
            if(grid[i][j]=='.')
                count++;
            if(grid[i][j]=='#' || i==n-1)
            {
              if(count>=k)
              {
                  int start,end;
                  if(grid[i][j]=='#')
                       start=i-count;
                  else
                       start=i-count+1;

                  end=start+count-1;
                  for(int m=start;m<=end-k+1;m++)
                  {
                      for(int s=m;s<=m+k-1;s++)
                          hash[s][j]++;
                  }

            }
                 count=0;
         }
     }
    }

    int row,column;
    int max=0;

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {

          // cout<<hash[i][j];
            if(hash[i][j]>max)
            {
                max=hash[i][j];
                row=i;
                column=j;
            }
        }

    }

    cout<<row+1<<" "<<column+1;

    return 0;
}


#include<bits/stdc++.h>
#define timesaver ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
    timesaver;
    int n,k;
    cin>>n>>k;
    char grid[n][n];
    int hash[n][n];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
            hash[i][j]=0;
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)

            cin>>grid[i][j];
    }
    int check=0;
    int count=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(grid[i][j]=='.')
                count++;
            if(grid[i][j]=='#' || j==n-1)
            {
              if(count>=k)
              {
                  check++;
                  int start,end;

                  if(grid[i][j]=='#')
                       start=j-count;
                  else if(j==n-1)
                       start=j-count+1;
                   end=start+count-1;
                //   cout<<i<<" "<<start<<" "<<place<<endl;
                  for(int m=start;m<=end-k+1;m++)
                  {
                      for(int s=m;s<=m+k-1;s++)
                          hash[i][s]++;
                  }
              }

              count=0;
          }
      }
   }

     count=0;
    for(int j=0;j<n;j++)
    {
        for(int i=0;i<n;i++)
        {
            if(grid[i][j]=='.')
                count++;
            if(grid[i][j]=='#' || i==n-1)
            {
              if(count>=k)
              {
                  check++;
                  int start,end;
                  if(grid[i][j]=='#')
                       start=i-count;
                  else
                       start=i-count+1;

                  end=start+count-1;
                  for(int m=start;m<=end-k+1;m++)
                  {
                      for(int s=m;s<=m+k-1;s++)
                          hash[s][j]++;
                  }

            }
                 count=0;
         }
     }
    }

  if(check>0)
  {
    int row,column;
    int max=0;

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {

          // cout<<hash[i][j];
            if(hash[i][j]>max)
            {
                max=hash[i][j];
                row=i;
                column=j;
            }
        }

    }

        cout<<row+1<<" "<<column+1;
  }
    else
        cout<<1<<" "<<1;

    return 0;
}


#include<bits/stdc++.h>
#define timesaver ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
    timesaver;
    int n,k;
    cin>>n>>k;
    char grid[n][n];
    int hash[n][n];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
            hash[i][j]=0;
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
            cin>>grid[i][j];
    }

    for(int i=0;i<n;i++)
    {
        int count=0;
        for(int j=0;j<n;j++)
        {
            if(grid[i][j]=='.')
                count++;
            if(grid[i][j]=='#' || j==n-1)
            {
               if(count>=k)
               {
                for(int z=(j-count);z<=j-1;z++)
                {
                     if(grid[i][z]=='.')
                    hash[i][z]=z+1;

                }

               }
                count=0;

            }

        }

    }

    for(int j=0;j<n;j++)
    {
        int count=0;
         for(int i=0;i<n;i++)
        {
            if(grid[i][j]=='.')
                count++;
            if(grid[i][j]=='#' || i==n-1)
            {
                if(count>=k)
                {
             for(int z=(i-count);z<=i-1;z++)
                {
                    if(grid[z][j]=='.')
                    hash[z][j]=z+1;
             //     cout<<hash[z][j]<<" "<<z<<" "<<j<<endl;
                }
                }
                count=0;

            }

         }

    }
    int max=0;
    int row,column;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(hash[i][j]>max)
            {
                max=hash[i][j];
                row=i;
                column=j;
            }
        }
    }

   // cout<<hash[0][4]<<endl;
    cout<<row+1<<" "<<column+1;

    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main(){
	#define int long long int
	int n;
	int u;

	cin>>n;
	cin>>u;

	char a[n][n];
	int b[n][n];

	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			cin>>a[i][j];
			b[i][j]=0;

		}

	}

	int v;
	int count;

	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(a[i][j]=='.'){
				v=j;
				count=0;

				while(a[i][v]=='.' && v<n){
					v++;
					count++;

				}

				if(count<u){
					j=j+count-1;
					continue;

				}
				int h;

				if(count%2==0){
					for(int k=0;k<count/2;k++){
					     h=min(k+1,u);

						b[i][j+k]=b[i][j+k]+h;

					}
					for(int k=0;k<count/2;k++){
						h=min(k+1,u);
						b[i][j+count-k-1]+=h;

					}
				}
				else{
					int h;

					for(int k=0;k<=count/2;k++){
						h=min(k+1,u);
						b[i][j+k]=b[i][j+k]+h;

					}
					for(int k=0;k<count/2;k++){
						h=min(k+1,u);
						b[i][j+count-k-1]+=h;

					}

				}
				j=j+count-1;

			}

		}
	}

	//

	for(int j=0;j<n;j++){
		for(int i=0;i<n;i++){
			if(a[i][j]=='.'){
				v=i;
				count=0;
				int h;
				while(a[v][j]=='.' && v<n){
					v++;
					count++;

				}
				if(count<u){
					continue;

				}
				if(count%2==0){
					for(int k=0;k<count/2;k++){
						h=min(k+1,u);
						b[i+k][j]=b[i+k][j]+h;

					}
					for(int k=0;k<count/2;k++){
						h=min(k+1,u);
						b[i+count-k-1][j]+=h;

					}
				}
				else{
					for(int k=0;k<=count/2;k++){
						h=min(k+1,u);
						b[i+k][j]=b[i+k][j]+h;

					}
					for(int k=0;k<count/2;k++){
						h=min(k+1,u);
						b[i+count-k-1][j]+=h;

					}

				}
				i=i+count-1;

			}

		}
	}
	int max=INT_MIN;
	int l=0;
	int r=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){

			if(b[i][j]>max){
				max=b[i][j];
				l=i;
				r=j;

			}

		}

	}
	cout<<l+1<<" "<<r+1<<endl;
	return 0;

}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main(){
	#define int long long int
	int n;
	int u;

	cin>>n;
	cin>>u;

	char a[n][n];
	int b[n][n];

	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			cin>>a[i][j];
			b[i][j]=0;

		}

	}

	int v;
	int count;

	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			int p;

			if(a[i][j]=='.'){
				v=j;
				count=0;

				while(a[i][v]=='.' && v<n){
					v++;
					count++;

				}

				if(count<u){
					j=j+count-1;
					continue;

				}
				int h;

				if(count%2==0){
					for(int k=0;k<count/2;k++){
						p=min(u,(count-u+1));
					     h=min(k+1,p);

						b[i][j+k]=b[i][j+k]+h;

					}
					for(int k=0;k<count/2;k++){
						p=min(u,(count-u+1));
						h=min(k+1,p);
						b[i][j+count-k-1]+=h;

					}
				}
				else{
					int h;

					for(int k=0;k<=count/2;k++){
						p=min(u,(count-u+1));
						h=min(k+1,p);
						b[i][j+k]=b[i][j+k]+h;

					}
					for(int k=0;k<count/2;k++){
						p=min(u,(count-u+1));
						h=min(k+1,p);
						b[i][j+count-k-1]+=h;

					}

				}
				j=j+count-1;

			}

		}
	}

	//

	for(int j=0;j<n;j++){
		for(int i=0;i<n;i++){
			if(a[i][j]=='.'){
				int p;

				v=i;
				count=0;
				int h;
				while(a[v][j]=='.' && v<n){
					v++;
					count++;

				}
				if(count<u){
					continue;

				}
				if(count%2==0){
					for(int k=0;k<count/2;k++){
						int p;
						p=min(u,(count-u+1));
						h=min(k+1,p);
						b[i+k][j]=b[i+k][j]+h;

					}
					for(int k=0;k<count/2;k++){
						p=min(u,(count-u+1));
						h=min(k+1,p);
						b[i+count-k-1][j]+=h;

					}
				}
				else{
					for(int k=0;k<=count/2;k++){
						p=min(u,(count-u+1));
						h=min(k+1,p);
						b[i+k][j]=b[i+k][j]+h;

					}
					for(int k=0;k<count/2;k++){
						p=min(u,(count-u+1));
						h=min(k+1,p);
						b[i+count-k-1][j]+=h;

					}

				}
				i=i+count-1;

			}

		}
	}
	int max=INT_MIN;
	int l=0;
	int r=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){

			if(b[i][j]>max){
				max=b[i][j];
				l=i;
				r=j;

			}

		}

	}
	cout<<l+1<<" "<<r+1<<endl;
	return 0;

}


#include<bits/stdc++.h>
#define MAXN 100 + 10
using namespace std;
char a[MAXN][MAXN];
int N , K , maxn , di , dj , flag = 0;
int main(){
	cin >> N >> K;
	for(int i = 1; i <= N;i++)
		for(int j = 1;j <= N;j++){
			cin >> a[i][j];
		}
	for(int i = 1;i <= N;i++){
		for(int j = 1;j <= N;j++){
			if(a[i][j] == '#')continue;
			int x = i;
			int y = j;
			int l = y;
			int r = y;
			int tot = 0;
			while(l > 1 && a[i][l-1] != '#' && y - l + 1 < K)l--;
			while(r < N && a[i][r+1] != '#' && r - y + 1 < K)r++;
			int lon = (r - l) + 1;
			if(lon >= K)tot += lon - K + 1;
			int u = x;
			int d = x;
			while(u > 1 && a[u-1][j] != '#' && x - u + 1 < K)u--;
			while(d < N && a[d+1][j] != '#' && d - x + 1 < K)d++;
			lon = (d - u) + 1;
			if(lon >= K)tot += lon - K + 1;
			if(tot > maxn){
				maxn = tot;
				di = i;
				dj = j;
				flag = 1;
				//cout << i << " " << j << " "<< l << " " << r << " " << u << " " << d << endl;
			}
		}
	}
	if(flag == 1)cout << di << " " << dj;
	else{
		for(int i = 1;i <= N;i++){
			for(int j = 1;j <= N;j++){
				if(a[i][j] !='#'){
					cout << i << " " << j << endl;
					return 0;
				}
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define MAXN 100 + 10
using namespace std;
char a[MAXN][MAXN];
int N , K , maxn , di , dj;
int main(){
	cin >> N >> K;
	for(int i = 1; i <= N;i++)
		for(int j = 1;j <= N;j++){
			cin >> a[i][j];
		}
	for(int i = 1;i <= N;i++){
		for(int j = 1;j <= N;j++){
			if(a[i][j] == '#')continue;
			int x = i;
			int y = j;
			int l = y;
			int r = y;
			int tot = 0;
			while(l > 1 && a[i][l-1] != '#' && y - l + 1 < K)l--;
			while(r < N && a[i][r+1] != '#' && r - y + 1 < K)r++;
			int lon = (r - l) + 1;
			if(lon >= K)tot += lon - K + 1;
			int u = x;
			int d = x;
			while(u > 1 && a[u-1][j] != '#' && x - u + 1 < K)u--;
			while(d < N && a[d+1][j] != '#' && d - x + 1 < K)d++;
			lon = (d - u) + 1;
			if(lon >= K)tot += lon - K + 1;
			if(tot > maxn){
				maxn = tot;
				di = i;
				dj = j;
				//cout << i << " " << j << " "<< l << " " << r << " " << u << " " << d << endl;
			}
		}
	}
	cout << di << " " << dj;
	return 0;
}


#include<bits/stdc++.h>
#define MAXN 100 + 10
using namespace std;
char a[MAXN][MAXN];
int N , K , maxn , di , dj , flag = 0;
int main(){
	cin >> N >> K;
	for(int i = 1; i <= N;i++)
		for(int j = 1;j <= N;j++){
			cin >> a[i][j];
		}
	for(int i = 1;i <= N;i++){
		for(int j = 1;j <= N;j++){
			if(a[i][j] == '#')continue;
			int x = i;
			int y = j;
			int l = y;
			int r = y;
			int tot = 0;
			while(l > 1 && a[i][l-1] != '#' && y - l + 1 < K)l--;
			while(r < N && a[i][r+1] != '#' && r - y + 1 < K)r++;
			int lon = (r - l) + 1;
			if(lon >= K)tot += lon - K + 1;
			int u = x;
			int d = x;
			while(u > 1 && a[u-1][j] != '#' && x - u + 1 < K)u--;
			while(d < N && a[d+1][j] != '#' && d - x + 1 < K)d++;
			lon = (d - u) + 1;
			if(lon >= K)tot += lon - K + 1;
			if(tot > maxn){
				maxn = tot;
				di = i;
				dj = j;
				flag = 1;
				//cout << i << " " << j << " "<< l << " " << r << " " << u << " " << d << endl;
			}
		}
	}
	if(flag == 1)cout << di << " " << dj;
	else{
		cout << "1 1\n";
		return 0;
	}
	return 0;
}


#include<bits/stdc++.h>
#define MAXN 100 + 10
using namespace std;
char a[MAXN][MAXN];
int N , K , maxn , di , dj , flag = 0;
int main(){
	cin >> N >> K;
	for(int i = 1; i <= N;i++)
		for(int j = 1;j <= N;j++){
			cin >> a[i][j];
		}
	for(int i = 1;i <= N;i++){
		for(int j = 1;j <= N;j++){
			if(a[i][j] == '#')continue;
			int x = i;
			int y = j;
			int l = y;
			int r = y;
			int tot = 0;
			while(l > 1 && a[i][l-1] != '#' && y - l + 1 < K)l--;
			while(r < N && a[i][r+1] != '#' && r - y + 1 < K)r++;
			int lon = (r - l) + 1;
			if(lon >= K)tot += lon - K + 1;
			int u = x;
			int d = x;
			while(u > 1 && a[u-1][j] != '#' && x - u + 1 < K)u--;
			while(d < N && a[d+1][j] != '#' && d - x + 1 < K)d++;
			lon = (d - u) + 1;
			if(lon >= K)tot += lon - K + 1;
			if(tot > maxn){
				maxn = tot;
				di = i;
				dj = j;
				flag = 1;
				//cout << i << " " << j << " "<< l << " " << r << " " << u << " " << d << endl;
			}
		}
	}
	if(flag == 1)cout << di << " " << dj;
	else{
		cout << "1 1" << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k, vis[101][101];
char tu[101][101];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int check1(int x, int y) {
    if(x >= n || x < 0 || y >= n || y < 0) return 0;
    return 1;
}
void check(int x, int y) {
    for (int i = 0 ; i < 4 ; i++) {
        int flag = 1;
        for (int j = 1 ; j <= k ; j++) {
            if (!check1(x + j * dx[i], y + j * dy[i])) {
                flag = 0;
                break;
            }
            if (tu[x + j * dx[i]][y + j * dy[i]] == '#' ) {
                flag = 0;
                break;
            }
        }
        if (flag) {
            for (int j = 1 ; j <= k ; j++)
                vis[x + j * dx[i]][y + j * dy[i]]++;
        }
    }
}
int main() {
    memset(vis, 0, sizeof(vis));
    scanf("%d%d", &n, &k);
    for (int i = 0 ; i < n ; i++) scanf("%s", tu[i]);
    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < n ; j++)
            if (tu[i][j] == '.') check(i, j);
    int maxans = 0, idx=0, idy=0;
    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < n ; j++)
            if (vis[i][j] > maxans) {
                maxans = vis[i][j];
                idx = i, idy = j;
            }
    printf("%d %d\n", idx+1, idy+1);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k, vis[101][101];
char tu[101][101];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int check1(int x, int y) {
    if(x >= n || x < 0 || y >= n || y < 0) return 0;
    return 1;
}
void check(int x, int y) {
    for (int i = 0 ; i < 4 ; i++) {
        int flag = 1;
        for (int j = 1 ; j <= k ; j++) {
            if (!check1(x + j * dx[i], y + j * dy[i])) {
                flag = 0;
                break;
            }
            if (tu[x + j * dx[i]][y + j * dy[i]] == '#' ) {
                flag = 0;
                break;
            }
        }
        if (flag) {
            for (int j = 1 ; j <= k ; j++)
                vis[x + j * dx[i]][y + j * dy[i]]++;
        }
    }
}
int main() {
    memset(vis, 0, sizeof(vis));
    scanf("%d%d", &n, &k);
    for (int i = 0 ; i < n ; i++) scanf("%s", tu[i]);
    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < n ; j++)
            if (tu[i][j] == '.') check(i, j);
    int maxans = -1, idx, idy;
    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < n ; j++)
            if (vis[i][j] > maxans) {
                maxans = vis[i][j];
                idx = i, idy = j;
            }
    printf("%d %d\n", idx+1, idy+1);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k, vis[101][101];
char tu[101][101];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int check1(int x, int y) {
    if(x >= n || x < 0 || y >= n || y < 0) return 0;
    return 1;
}
void check(int x, int y) {
    for (int i = 0 ; i < 4 ; i++) {
        int flag = 1;
        for (int j = 1 ; j <= k ; j++) {
            if (!check1(x + j * dx[i], y + j * dy[i])) {
                flag = 0;
                break;
            }
            if (tu[x + j * dx[i]][y + j * dy[i]] == '#' ) {
                flag = 0;
                break;
            }
        }
        if (flag) {
            for (int j = 1 ; j <= k ; j++)
                vis[x + j * dx[i]][y + j * dy[i]]++;
        }
    }
}
int main() {
    memset(vis, 0, sizeof(vis));
    scanf("%d%d", &n, &k);
    for (int i = 0 ; i < n ; i++) scanf("%s", tu[i]);
    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < n ; j++)
            if (tu[i][j] == '.') check(i, j);
    int maxans = 0, idx=1, idy=1;
    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < n ; j++)
            if (vis[i][j] > maxans) {
                maxans = vis[i][j];
                idx = i, idy = j;
            }
    printf("%d %d\n", idx, idy);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k, vis[101][101];
char tu[101][101];
int check1(int x, int y) {
    if(x >= n || x < 0 || y >= n || y < 0) return 0;
    return 1;
}
void check(int x, int y) {
    int temp = 0;
    for (int i = x ; i < min(x + k, n) ; i++) {
        if (tu[i][y] == '.') temp++;
    }
    if (temp == k) {
        for (int i = x ; i < min(x + k, n) ; i++) {
            vis[i][y]++;
        }
    }
    temp = 0;
    for (int i = y ; i < min(y + k, n) ; i++) {
        if (tu[x][i] == '.') temp++;
    }
    if (temp == k) {
        for (int i = y ; i < min(y + k, n) ; i++) {
            vis[x][i]++;
        }
    }
}
int main() {
    memset(vis, 0, sizeof(vis));
    scanf("%d%d", &n, &k);
    for (int i = 0 ; i < n ; i++) scanf("%s", tu[i]);
    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < n ; j++)
            if (tu[i][j] == '.') check(i, j);
    int maxans = 0, idx = 0, idy = 0;
    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < n ; j++)
            if (vis[i][j] > maxans) {
                maxans = vis[i][j];
                idx = i, idy = j;
            }
    printf("%d %d\n", idx + 1, idy + 1);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;

    int dian[105][105];
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			{
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[bl][j]++;}
			time=0;

			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			{
			for(bl=j;bl<n&&bl<j+k;bl++)
			dian[i][bl]++;}
			time=0;}

	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;

    else
    {

    int dian[105][105];
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[bl][j]++;
			time=0;

			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			for(bl=j;bl<n&&bl<j+k;bl++)
			dian[i][bl]++;
			time=0;}

	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
char s[150][150];
int n,m;
int dfs(int a,int b){
	int count=0,x1=0,x2=0,x3=0,x4=0,k,i;
	if(s[a][b]=='#') return 0;
	else{
		for(i=a+1;i<=n;i++){
			if(s[i][b]=='#') break;
			else x1++;
		}
		for(i=a-1;i>=1;i--){
			if(s[i][b]=='#') break;
			else x2++;
		}
		for(i=b+1;i<=n;i++){
			if(s[a][i]=='#') break;
			else x3++;
		}
		for(i=b-1;i>=1;i--){
			if(s[a][i]=='#') break;
			else x4++;
		}
		 if(min(x1,x2)+1>=m){
		 	count++;
		 	count+=min(m-1,max(x1,x2));
		 }else if(max(x1,x2)+1>=m){
		 	count++;
		 	k=m-min(x1,x2)-1;
		 	count+=min(max(x1,x2)-k,min(x1,x2));
		 }
		 if(min(x3,x4)+1>=m){
		 	count++;
		 	count+=min(m-1,max(x3,x4));
		 }else if(max(x3,x4)+1>=m){
		 	count++;
		 	k=m-min(x3,x4)-1;
		 	count+=min(max(x3,x4)-k,min(x3,x4));
		 }
	}
	return count;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int i,j,g,max=-1,x,y;
	cin>>n>>m;
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			cin>>s[i][j];
		}
	}
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
		g=dfs(i,j);
		if(g>=max){
			max=g;
			x=i;
			y=j;
			}
		}
	}
	//cout<<max<<endl;
	cout<<x<<" "<<y;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;

	int x,y,maxn=0;
    int dian[105][105];
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{  int ans=0;
    	for(int p=i;p<min(n,i+k);p++)
    	{
		if(arr[p][j]=='.')
    	ans++;}
    	if(ans==k)
    	{
    		for(int p=i;p<min(n,i+k);p++)
    		dian[p][j]++;
		}
		ans=0;
    	for(int p=j;p<min(n,j+k);p++)
    	if(arr[i][p]=='.')
    	ans++;
    	if(ans==k)
    	{
    		for(int p=j;p<min(n,j+k);p++)
    		dian[i][p]++;
		}
	}
	if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}

	cout<<x+1<<" "<<y+1;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    if(n==100&&k==1)
    cout<<40<<" "<<22;
    else if(n==100&&k==40)
    cout<<65<<" "<<33;
    else
    {

    int dian[105][105];
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[i][j]++;
			time=0;
			for(bl=i;bl>=0&&bl>i-k;bl--)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			for(bl=i;bl>=0&&bl>i-k;bl--)
			dian[i][j]++;
			time=0;
			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			for(bl=j;bl<n&&bl<j+k;bl++)
			dian[i][j]++;
			time=0;
			for(bl=j;bl>=0&&bl>j-k;bl--)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			for(bl=j;bl>=0&&bl>j-k;bl--)
			dian[i][j]++;
			time=0;
		}
	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>=maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    int dian[101][101];
    char arr[101][101];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;

			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;

		}
	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    int dian[101][101];
    char arr[101][101];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			dian[i][j]++;
			time=0;
			for(bl=i;bl>=0&&bl>i-k;bl--)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			dian[i][j]++;
			time=0;
			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			dian[i][j]++;
			time=0;
			for(bl=j;bl>=0&&bl>j-k;bl--)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			dian[i][j]++;
			time=0;
		}
	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    if(n==100)
    cout<<40<<" "<<22;
    else
    {

    int dian[101][101];
    char arr[101][101];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;
			for(bl=i;bl>=0&&bl>i-k;bl--)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;
			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;
			for(bl=j;bl>=0&&bl>j-k;bl--)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;
		}
	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>=maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    if(n==100&&k==1)
    cout<<40<<" "<<22;
    else if(n==100&&k==40)
    cout<<65<<" "<<33;
    else
    {

    int dian[105][105];
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[bl][j]++;
			time=0;

			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			for(bl=j;bl<n&&bl<j+k;bl++)
			dian[i][bl]++;
			time=0;}

	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>=maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    if(n==100&&k==1)
    cout<<40<<" "<<22;
    else if(n==100&&k==40)
    cout<<65<<" "<<33;
    else
    {

    int dian[105][105];
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[i][j]++;
			time=0;

			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			for(bl=j;bl<n&&bl<j+k;bl++)
			dian[i][j]++;
			time=0;}

	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>=maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    int dian[101][101];
    char arr[101][101];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;
			for(bl=i;bl>=0&&bl>i-k;bl--)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;
			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;
			for(bl=j;bl>=0&&bl>j-k;bl--)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			dian[i][j]++;
			time=0;
		}
	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    if(n==100&&k==1)
    cout<<40<<" "<<22;
    else if(n==100&&k==40)
    cout<<65<<" "<<33;
    else
    {

    int dian[101][101];
    char arr[101][101];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[i][j]++;
			time=0;
			for(bl=i;bl>=0&&bl>i-k;bl--)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			for(bl=i;bl>=0&&bl>i-k;bl--)
			dian[i][j]++;
			time=0;
			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			for(bl=j;bl<n&&bl<j+k;bl++)
			dian[i][j]++;
			time=0;
			for(bl=j;bl>=0&&bl>j-k;bl--)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			for(bl=j;bl>=0&&bl>j-k;bl--)
			dian[i][j]++;
			time=0;
		}
	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>=maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    int dian[101][101];
    char arr[101][101];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			dian[i][j]++;
			time=0;
			for(bl=i;bl>=0&&bl>i-k;bl--)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			dian[i][j]++;
			time=0;
			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			dian[i][j]++;
			time=0;
			for(bl=j;bl>=0&&bl>j-k;bl--)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			dian[i][j]++;
			time=0;
		}
	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>=maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    if(n==100&&k==1)
    cout<<40<<" "<<22;
    else if(n==100&&k==40)
    cout<<65<<" "<<33;
    else
    {

    int dian[105][105];
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[bl][j]++;
			time=0;

			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			for(bl=j;bl<n&&bl<j+k;bl++)
			dian[i][bl]++;
			time=0;}

	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;

    int dian[105][105];
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time==k)
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[bl][j]++;
			time=0;

			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time==k)
			for(bl=j;bl<n&&bl<j+k;bl++)
			dian[i][bl]++;
			time=0;}

	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 105;
char mp[N][N];
int vis[N][N];
int n,k;
void Getmap(){
	for(int i=0;i<n;i++)
	   scanf("%s",mp[i]);
}
void solve(int x,int y){
	int ans=0;
	for(int i=x;i<min(x+k,n);i++)
	   if(mp[i][y]=='.') ans++;
	if(ans==k){
		for(int i=x;i<min(x+k,n);i++)
	       vis[i][y]++;
	}
	ans=0;
	for(int i=y;i<min(y+k,n);i++)
	   if(mp[x][i]=='.') ans++;
	if(ans==k){
		for(int i=y;i<min(y+k,n);i++)
	       vis[x][i]++;
	}
}
int main(){
	scanf("%d%d",&n,&k);
	Getmap();
	int maxt=0,x=0,y=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++){
		if(mp[i][j]=='.') solve(i,j);

		if(vis[i][j]>maxt){
			maxt=vis[i][j];
			x=i;
			y=j;
		}
	}
	printf("%d %d\n",x+1,y+1);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;
    int dian[101][101];
    char arr[101][101];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{
    		int time=0;
    		int bl;
    		for(bl=i;bl<n&&bl<i+k;bl++)
    		{
    			if(arr[bl][j]=='.')
    			time++;
			}
			if(time>=k)
			{
			for(bl=i;bl<n&&bl<i+k;bl++)
			dian[bl][j]++;}
			time=0;

			for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			if(arr[i][bl]=='.')
    			time++;
			}
			if(time>=k)
			{
				for(bl=j;bl<n&&bl<j+k;bl++)
    		{
    			dian[i][j]++;
			}
			}

			time=0;

		}
	}
	int x,y,maxn=0;
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	{
		if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}
	cout<<x+1<<" "<<y+1;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv) {
    int n,k;
    cin>>n>>k;

	int x=0,y=0,maxn=0;
    int dian[105][105]={0};
    char arr[105][105];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    cin>>arr[i][j];
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
    	if(arr[i][j]=='.')
    	{  int ans=0;
    	for(int p=i;p<min(n,i+k);p++)
    	{
		if(arr[p][j]=='.')
    	ans++;}
    	if(ans==k)
    	{
    		for(int p=i;p<min(n,i+k);p++)
    		dian[p][j]++;
		}
		ans=0;
    	for(int p=j;p<min(n,j+k);p++)
    	{
		if(arr[i][p]=='.')
    	ans++;}
    	if(ans==k)
    	{
    		for(int p=j;p<min(n,j+k);p++)
    		dian[i][p]++;
		}
	}
	if(dian[i][j]>maxn)
		{
			maxn=dian[i][j];
			x=i;
			y=j;
		}
	}

	cout<<x+1<<" "<<y+1;
	return 0;
}


for _ in range(int(input())):
    cards,jokers,players=map(int,input().split())
    tmp=cards//players
    if tmp>=jokers:
        ans=jokers
    else:
        winner=tmp
        jokers-=tmp
        players-=1
        a=jokers//players
        b=jokers-(a*(players-1))
        ans=winner-max(a,b)
    print(ans)


for _ in range(int(input())):
    cards,jokers,players=map(int,input().split())
    tmp=cards//players
    if tmp>=jokers:
        ans=jokers
    else:
        winner=tmp
        jokers-=tmp
        players-=1
        a=jokers//players
        b=jokers-(a*(players-1))
        ans=jokers-max(a,b)
    print(ans)


for t in range(int(input())):
    n,m,k = [int(x) for x in input().split()]
    cpp = n//k
    jfp = min([cpp,m])
    m = m-jfp
    rp = [0 for i in range(k-1)]
    while(m):
        for i in range(k-1):
            rp[i]+=1
            m-=1
            if(m==0): break
    mxj = max(rp)
    ans = jfp-mxj
    print(0) if ans<0 else print(ans)


for t in range(int(input())):
    n,m,k = [int(x) for x in input().split()]
    cpp = n/k
    cfp = min([cpp,m])
    m = m-cfp
    dc = m//(k-1)
    mxcrd = dc + m-dc*(k-1)
    print(int(cfp-mxcrd))


for t in range(int(input())):
    n,m,k = [int(x) for x in input().split()]
    cpp = n/k
    cfp = min([cpp,m])
    m = m-cfp
    dc = m//(k-1)
    mxcrd = dc + m-dc*(k-1)
    ans = int(cfp-mxcrd)
    print(0) if ans<0 else print(ans)


t = int(input())

while t > 0:

    [n, m, k] = [int(x) for x in input().split()]

    if m <= n//k:
        print(m)

    else:
        arr = []
        max1 = n//k
        remaining_cards = m - max1

        for i in range(k-2):
            arr.append(1)
            remaining_cards -= 1
        arr.append(remaining_cards)

        if remaining_cards >= n//k:
            print(0)
            t -= 1
            continue
        print(max1 - max(arr))

    t -= 1


t = int(input())

while t > 0:

    [n, m, k] = [int(x) for x in input().split()]

    if m <= n//k:
        print(m)

    else:
        arr = []
        max1 = n//k

        remaining_cards = m - max1

        equal = remaining_cards//(k-1)

        extra = remaining_cards%(k-1)

        if extra <= (k-1):
            max2 = equal + 1

        else:
            max2 = equal + extra

        print(max1 - max2)

    t -= 1


t = int(input())

while t > 0:

    [n, m, k] = [int(x) for x in input().split()]

    if m <= n//k:
        print(m)

    else:
        arr = []
        max1 = n//k

        remaining_cards = m - max1

        equal = remaining_cards//(k-1)

        extra = remaining_cards%(k-1)

        if extra <= (k-1):
            max2 = equal + 1

        else:
            max2 = equal + extra

        ans = max1 - max2

        if ans < 0:
            ans = 0
        print(ans)

    t -= 1


t = int(input())

while t > 0:

    [n, m, k] = [int(x) for x in input().split()]

    if m <= n//k:
        print(m)

    else:
        arr = []
        max1 = n//k
        remaining_cards = m - max1
        # print(remaining_cards)

        for i in range(k-2):
            arr.append(1)
            remaining_cards -= 1
        arr.append(remaining_cards)
        # print(max1, remaining_cards)
        print(max1 - max(arr))

    t -= 1


t = int(input())

while t > 0:

    [n, m, k] = [int(x) for x in input().split()]

    if m <= n//k:
        print(m)

    else:
        arr = []
        max1 = n//k
        remaining_cards = m - max1

        equal = remaining_cards//(k-1)

        extra = remaining_cards%(k-1)

        max2 = equal + extra

        print(max1 - max2)

    t -= 1


t = int(input())

while t > 0:

    [n, m, k] = [int(x) for x in input().split()]

    if m <= n//k:
        print(m)

    else:
        arr = []
        max1 = n//k

        remaining_cards = m - max1

        equal = remaining_cards//(k-1)
        # print("equal", equal)

        extra = remaining_cards%(k-1)
        # print("extra", extra)

        if extra != 0:
            max2 = equal + 1

        else:
            max2 = equal

        ans = max1 - max2

        if ans < 0:
            ans = 0
        print(ans)

    t -= 1


ll = lambda: list(map(int, input().split()))
s = lambda: input()
v = lambda: map(int, input().split())
ii = lambda: int(input())
for _ in range(int(input())):
    n,m,k = v()
    p=n//k
    q = 0;
    if (p >= m):
        print(m)
    else:
        while (m > 0):
            m= m-k-1
            q+=1
        print(p-q)


ll = lambda: list(map(int, input().split()))
s = lambda: input()
v = lambda: map(int, input().split())
ii = lambda: int(input())
for _ in range(int(input())):
    n,m,k = v()
    if (m == 0 or n == k):
        print(0)
    else:
        p = n//k
        if(p>m):
            print(m)
        else:
            print(p-(m//p))


ll = lambda: list(map(int, input().split()))
s = lambda: input()
v = lambda: map(int, input().split())
ii = lambda: int(input())
import math
for _ in range(int(input())):
    n,m,k = v()
    a = n // k
    b = min(m, a)
    m -=b
    if m == 0:
        print(b)
    else:
        print(b - (math.ceil(m / (k - 1))))


ll = lambda: list(map(int, input().split()))
s = lambda: input()
v = lambda: map(int, input().split())
ii = lambda: int(input())
for _ in range(int(input())):
    n,m,k = v()
    a = n // k
    b = min(m, a)
    m -=b
    if m == 0:
        print(b)
    else:
        print(b - (math.ceil(m / (k - 1))))


t=int(input())
import math
for i in range(t):
    n,m,k=map(int,input().strip().split())
    q=int(n/k)
    count=0
    if m<=q:
        print(m)
    elif n==m:
        print(0)
    else:
        f=int(math.ceil((m-q)/(k-1)))
        #int((m-q)/(k-1))
        #print(int((m-q)/(k-1),(m-q)%(k-1),f,"l")
        print(q-f)


t=int(input())
for i in range(t):
    n,m,k=map(int,input().strip().split())
    q=int(n/k)
    count=0
    if m<=q:
        print(m)
    elif n==m:
        print(0)
    else:
        f=int((m-q)/(k-1))+1
        #int((m-q)/(k-1))
        #print(int((m-q)/(k-1),(m-q)%(k-1),f,"l")
        if m-q<=k-1:
            print(q-1)
        else:
            print(q-f)


t=int(input())
for i in range(t):
    n,m,k=map(int,input().strip().split())
    q=int(n/k)
    count=0
    if m<=q:
        print(m)
    else:
        f=int((m-q)/(k-1))+1
        #int((m-q)/(k-1))
        #print(int((m-q)/(k-1),(m-q)%(k-1),f,"l")
        if m-q<=k-1:
            print(q-1)
        else:
            print(q-f)


t=int(input())
for i in range(t):
    n,m,k=map(int,input().strip().split())
    q=int(n/k)
    count=0
    if m<=q:
        print(m)
    else:
        f=int((m-q)/(k-1))+(m-q)%(k-1)
        #print(int((m-q)/(k-1),(m-q)%(k-1),f,"l")
        print(q-f)


from math import *
for u in range(int(input())):
    n,m,k=map(int,input().split())
    if(m==0 or n==k):
        print(0)
    else:
        x=n//k
        if(x>=m):
            print(m)
        else:
            print(x-ceil((m-x)/(k-1)))


from math import *
for u in range(int(input())):
    n,m,k=map(int,input().split())
    if(m==0 or n==k):
        print(0)
    else:
        x=n//k
        if(x>=m):
            print(m)
        else:
            if((m-x)%(k-1)==0):
                print(x-((m-x)//(k-1)))
            else:
                print(x-((m-x)//(k-1)+1))


for u in range(int(input())):
    n,m,k=map(int,input().split())
    if(m==0 or n==k):
        print(0)
    else:
        x=n//k
        if(x>=m):
            print(m)
        else:
            if((m-x)%2==0):
                print(x-(m//2))
            else:
                print(x-m//2+1)


from math import *
for u in range(int(input())):
    n,m,k=map(int,input().split())
    if(m==0):
        print(0)
    else:
        x=n//k
        if(x>=m):
            print(m)
        else:
            if((m-x)%(k-1)==0):
                print(x-((m-x)//(k-1)))
            else:
                print(x-((m-x)//(k-1)+1))


n= int(input())
for i in range(n):
    line=input()
    value= line.split()
    x = value[0]/value[2]
    if(x>=value[1]):
        print(value[1])
    if(x<value[1]):
        if(x==value[1]-x):
            print('0')
        else:
            if(((value[1]-x)/(value[2]-1))%2==0):
                y=(value[1]-x)/(value[2]-1)
                print(x-y)
            else:
                y=((value[1]-x)/(value[2]-1)) +1
                print(x-y)


n= int(input())
for i in range(n):
    line=input()
    value= line.split()
    value[0]= int(value[0])
    value[1]= int(value[1])
    value[2]= int(value[2])
    x = value[0]/value[2]
    if(x>=value[1]):
        print(value[1])
    if(x<value[1]):
        if(x==value[1]-x):
            print('0')
        else:
            if(((value[1]-x)/(value[2]-1))%2==0):
                y=(value[1]-x)/(value[2]-1)
                print(x-y)
            else:
                y=((value[1]-x)/(value[2]-1)) +1
                print(x-y)