Olya loves energy drinks. She loves them so much that her room is full of empty cans from energy drinks.

Formally, her room can be represented as a field of *n* × *m* cells, each cell of which is empty or littered with cans.

Olya drank a lot of energy drink, so now she can run *k* meters per second. Each second she chooses one of the four directions (up, down, left or right) and runs from 1 to *k* meters in this direction. Of course, she can only run through empty cells.

Now Olya needs to get from cell (*x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>) to cell (*x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>). How many seconds will it take her if she moves optimally?

It's guaranteed that cells (*x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>) and (*x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>) are empty. These cells can coincide.
The first line contains three integers *n*, *m* and *k* (1 ≤ *n*, *m*, *k* ≤ 1000) — the sizes of the room and Olya's speed.

Then *n* lines follow containing *m* characters each, the *i*-th of them contains on *j*-th position "#", if the cell (*i*, *j*) is littered with cans, and "." otherwise.

The last line contains four integers *x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub> (1 ≤ *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub> ≤ *n*, 1 ≤ *y*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">2</sub> ≤ *m*) — the coordinates of the first and the last cells.
In the first sample Olya should run 3 meters to the right in the first second, 2 meters down in the second second and 3 meters to the left in the third second.

In second sample Olya should run to the right for 3 seconds, then down for 2 seconds and then to the left for 3 seconds.

Olya does not recommend drinking energy drinks and generally believes that this is bad.
3 4 4
....
###.
....
1 1 3 1
3
3 4 1
....
###.
....
1 1 3 1
8
2 2 1
.#
#.
1 1 2 2
-1
10 10 1
##########
#.........
#.#######.
#.#.....#.
#.#.###.#.
#.#.#.#.#.
#.#.#.#.#.
#.#.#...#.
#.#.#####.
#.#.......
6 6 10 2
48
10 10 3
##########
##########
##########
##########
##########
##########
##########
#########.
#########.
####..###.
10 6 10 5
1
10 10 3
...##..#..
#.#..#...#
..#.##.#..
##..#..#.#
..#...##..
.#.#.#....
#......#..
.#.####.##
......#...
.#.##...##
4 6 8 1
7
10 10 1000
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
7 6 1 3
2
10 10 1000
..........
..........
..........
..........
..........
..........
..........
..........
..........
.....#....
3 9 5 1
2
10 10 10
...#......
##.#.#####
...#...###
.#####.###
...#...###
##.#.#####
...#...###
.#####.###
.......###
##########
1 1 1 10
17
2 5 5
#####
##.##
2 3 2 3
0
4 4 4
...#
.#.#
....
##..
1 1 3 4
2
6 6 100
....##
.##.##
.##.##
......
###.##
###.##
1 1 4 6
2
//Divyanshu Srivastava
/*
                              _,add8ba,
                            ,d888888888b,
                           d8888888888888b                        _,ad8ba,_
                          d888888888888888)                     ,d888888888b,
                          I8888888888888888 _________          ,8888888888888b
                __________`Y88888888888888P"""""""""""baaa,__ ,888888888888888,
            ,adP"""""""""""9888888888P""^                 ^""Y8888888888888888I
         ,a8"^           ,d888P"888P^                           ^"Y8888888888P'
       ,a8^            ,d8888'                                     ^Y8888888P'
      a88'           ,d8888P'                                        I88P"^
    ,d88'           d88888P'                                          "b,
   ,d88'           d888888'                                            `b,
  ,d88'           d888888I                                              `b,
  d88I           ,8888888'            ___                                `b,
 ,888'           d8888888          ,d88888b,              ____            `b,
 d888           ,8888888I         d88888888b,           ,d8888b,           `b
,8888           I8888888I        d8888888888I          ,88888888b           8,
I8888           88888888b       d88888888888'          8888888888b          8I
d8886           888888888       Y888888888P'           Y8888888888,        ,8b
88888b          I88888888b      `Y8888888^             `Y888888888I        d88,
Y88888b         `888888888b,      `""""^                `Y8888888P'       d888I
`888888b         88888888888b,                           `Y8888P^        d88888
 Y888888b       ,8888888888888ba,_          _______        `""^        ,d888888
 I8888888b,    ,888888888888888888ba,_     d88888888b               ,ad8888888I
 `888888888b,  I8888888888888888888888b,    ^"Y888P"^      ____.,ad88888888888I
  88888888888b,`888888888888888888888888b,     ""      ad888888888888888888888'
  8888888888888698888888888888888888888888b_,ad88ba,_,d88888888888888888888888
  88888888888888888888888888888888888888888b,`"""^ d8888888888888888888888888I
  8888888888888888888888888888888888888888888baaad888888888888888888888888888'
  Y8888888888888888888888888888888888888888888888888888888888888888888888888P
  I888888888888888888888888888888888888888888888P^  ^Y8888888888888888888888'
  `Y88888888888888888P88888888888888888888888888'     ^88888888888888888888I
   `Y8888888888888888 `8888888888888888888888888       8888888888888888888P'
    `Y888888888888888  `888888888888888888888888,     ,888888888888888888P'
     `Y88888888888888b  `88888888888888888888888I     I888888888888888888'
       "Y8888888888888b  `8888888888888888888888I     I88888888888888888'
         "Y88888888888P   `888888888888888888888b     d8888888888888888'
            ^""""""""^     `Y88888888888888888888,    888888888888888P'
                            "8888888888888888888b,   Y888888888888P^
                             `Y888888888888888888b   `Y8888888P"^
                                "Y8888888888888888P     `""""^
                                  `"YY88888888888P'
                                       ^""""""""'
*/

#include <bits/stdc++.h>

using namespace std;

#define t(w)  \
    ll w;     \
    cin >> w; \
    while (w--)

#define ipv(v, n)              \
    for (ll i = 0; i < n; i++) \
    {                          \
        ll a;                  \
        cin >> a;              \
        v.push_back(a);        \
    }

#define op(v)              \
    for (auto it : v)      \
        cout << it << " "; \
    cout << endl;

#define opm(m)                                     \
    for (auto it = m.begin(); it != m.end(); it++) \
        cout << it->first << " " << it->second << endl;

#define counter(v)   \
    map<ll, ll> feq; \
    for (auto a : v) \
        feq[a]++;

#define pr(n) cout << n << "\n";

#define pb push_back
#define all(v) v.begin(), v.end()
#define MX 1000000007

typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<ll> vi;

void solve()
{
    ll n, m, o, x1, y1, x2, y2;
    cin >> n >> m >> o;

    vector<string> grid(n);

    for (ll i = 0; i < n; i++)
    {
        cin >> grid[i];
    }

    cin >> x1 >> y1 >> x2 >> y2;

    x1--;
    x2--;
    y1--;
    y2--;

    vector<vector<ll>> dis(n, vector<ll>(m, 0));

    queue<pair<ll, ll>> q;
    q.push({x1, y1});
    dis[x1][y1] = 0;
    grid[x1][y1] = '#';

    vi dx = {0, 0, 1, -1};
    vi dy = {1, -1, 0, 0};

    int f = 0;

    while (!q.empty())
    {
        auto cur = q.front();
        ll i = cur.first;
        ll j = cur.second;

        if (i == x2 and j == y2)
        {
            pr(dis[i][j]);
            f = 1;
            return;
        }
        q.pop();

        for (ll k = 0; k < 4; k++)
        {
            ll l = 0;
            for (l = 1; i + dx[k] * l > -1 and i + dx[k] * l < n and j + dy[k] * l > -1 and j + dy[k] * l < m and grid[i + dx[k] * l][j + dy[k] * l] == '.' and l <= o; l++)
            {
                q.push({i + dx[k] * l, j + dy[k] * l});
                grid[i + dx[k] * l][j + dy[k] * l] = '#';
                dis[i + dx[k] * l][j + dy[k] * l] = dis[i][j] + 1;
            }
        }
    }
    pr(-1);
}

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

#ifndef ONLINE_JUDGE
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif

    {
        solve();
    }
}
