图书管理系统 Borrowers

题意翻译

你的任务是模拟一个图书管理系统。首先输入若干图书的标题和作者(标题各不相同,以END结束),然后是若干指令:BORROW指令表示借书,RETURN指令表示还书,SHELVE指令表示把所有已归还但还没有上架的图书排序后依次插入书架并输出图书标题和插入位置(可能是第一本书或者某本书的后面)。 图书排序的方法是先按作者从小到大排,再按标题从小到大排。在处理第一条指令之前,你应当现将所有图书按照这种方式排序。

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=4&page=show_problem&problem=166 [PDF](https://uva.onlinejudge.org/external/2/p230.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA230/080bb4c03724a95130bfbcbf99ca56637343b6dc.png)

输入输出格式

输入格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA230/09a2dbdba94471eaf8b74e77ff5188cc2fa76b1a.png)

输出格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA230/eea5cbbfe48805b94128530790d4e152ce9ed9a8.png)

输入输出样例

输入样例 #1

"The Canterbury Tales" by Chaucer, G.
"Algorithms" by Sedgewick, R.
"The C Programming Language" by Kernighan, B. and Ritchie, D.
END
BORROW "Algorithms"
BORROW "The C Programming Language"
RETURN "Algorithms"
RETURN "The C Programming Language"
SHELVE
END

输出样例 #1

Put "The C Programming Language" after "The Canterbury Tales"
Put "Algorithms" after "The C Programming Language"
END