the Berland Armed Forces System consist n rank number natural number 1 n 1 low rank n high rankOne need exactly di year rise rank rank i1 reach certain rank having reach previous i1 rank impossibleVasya reach new rank dream hold rank b find year Vasya serve army finally realize dream