To explain this, I should go out from news . This should be magazine. So
In the final result, I need to see 3 different pages.
/magazine - simple page for all magazines. Some list of all magazines
/magazine/20 - a magazine with the number 20.
/magazine/20/105 - page for an article with id 105, from magazine 20
****|---- index.md ← I expect to build this for /magazine page
******|—index.md ← I expect to build this for /magazine/20 page
******|—105.md ← I expect to build this for /magazine/20/105 page
****|— list.html ← I expect to build this for /magazine page
****|— single.html ← I expect to build this for /magazine/20 page
And right now I can’t get, where I should locate the template for /magazine/20/105 page
As I suspected, you have made magazine and magazine/20 ‘leaf’ bundles.
You need magazine/index.md and magazine/20/index.md to be _index.md.
For magazine/20/_index.md you will need to either override the layout (or type) or will need to make layouts/magazine/list.html suitable for both magazine and magazine/XX.
Since you don’t have any single pages under magazine itself, the layouts/magazine/single.html ought to work for magazine/XX/XXX.md.
Another option is to not render 105.md directly but to keep magazine/20 as a ‘leaf’ bundle and to use the articles as page resources used by the layout for magazine/20 (which would be the layouts/magazine/single.html layout).