Provide the code for a 15 Puzzle. The code should be written in Python with a UI of Kivy. The tiles should automatically resize when the window is made bigger or smaller so that they take up all available space. The aim of the game is to move the tiles so that they are in order from 1 to 15 with the blank at the lower right. Clicking on a tile will move it, provided it is adjacent to the blank.
Modify the application so that it begins from a solved state and then shuffle it by randomly moving positions 5000 times.
In this game, when the buttons are aligned from 1 to 15, starting form the top left, it should end the game. All the buttons should be hidden and a label should say "You won using X moves!" With X being replaced with the number of moves it took.