补:好像LREM是删除命令 ------------------ 为啥用Redis,当然是为了分布式了,可以N个工程一起使用对象池。
用Redis的List放入N个对象,使用时直接Pop出来使用即可,用完再push回去。
为了记录那些对象正在使用中,使用了另外一个Map。
本想用RPOPLPUSH "free" "working"直接从空闲队列弹出放入工作队列,
但是,归还时,需要从工作队列把指定的对象删除,
由于List中直接存的value,没有key,不好查找。
故无奈采用Map保存工作队列,key用对象的id之类的东西即可。
所以最终是: ------ (1)从名为free的list中pop出来一个对象,在名为working的map中存一下对象id。
(2)使用对象..
(3)从working的map中根据对象id删除,然后push回free的list
(4)可以搞个线程监控working的Map,如果时间太久就认为使用者忘了归还,处理一下。
(5)可以搞个线程监控free的list,如果不够用,就补充一些。如果是连接之类的对象,可以检测一下是否可用,不可用就拿走处理一下,弄好再放回来。反正就是保证该list的对象是可用的,够用的。如果无法保证,比如创建新对象时总出错,就得报警了,及时处理。
(6)另外一个监控,自然就是显示当前free和working的使用状态。 ------
测试代码如下:
package redis;
import java.util.Random;
import redis.clients.jedis.Jedis;
public class TestList { public static Random r = new Random();
public static void main(String[] args) {
// 初始放入数据 Jedis jedis = new Jedis("127.0.0.1", 6379); jedis.del("free"); jedis.del("working");
int num = 1; for (int i = 0; i < 5; i++) { jedis.lpush("free", "" + num); num++; } jedis.close();
// 监控free队列线程 new putThread().start();
// 打印线程 new printThread().start();
// 获取线程(每次3个线程,休息10秒钟,重复50次) for (int k = 0; k < 50; k++) { for (int i = 0; i < 3; i++) { Thread get = new getThread(); get.setName("get" + i); get.start(); } try { Thread.sleep(10000); } catch (InterruptedException e) { } }
}
}
class printThread extends Thread {
@Override public void run() {
Jedis jedis = new Jedis("127.0.0.1", 6379); for (int i = 0; i < 600; i++) { System.out.println("print free:" + jedis.lrange("free", 0, -1)); System.out.println("print work:" + jedis.hkeys("working")); try { Thread.sleep(1000); } catch (InterruptedException e) { } } jedis.close(); } }
class putThread extends Thread {
@Override public void run() {
Jedis jedis = new Jedis("127.0.0.1", 6379);
// 监控5分钟 int num = 100; for (int i = 0; i < 5; i++) {
try { Thread.sleep(1000 * 5); } catch (InterruptedException e) { }
// 小于10就补充 while (jedis.llen("free") < 10) { jedis.lpush("free", "" + num); num++; }
} jedis.close(); } }
class getThread extends Thread {
@Override public void run() {
// 随机延迟 try { int num = TestList.r.nextInt(1000); Thread.sleep(num); } catch (InterruptedException e) { }
Jedis jedis = new Jedis("127.0.0.1", 6379); for (int i = 0; i < 2; i++) { String row = jedis.rpop("free"); System.out.println(Thread.currentThread().getName() + " get :" + row);
// 放入map,代表正在使用 jedis.hset("working", row, "111");
// 随机延迟 try { int num = TestList.r.nextInt(2000); Thread.sleep(num); } catch (InterruptedException e) { }
// 从Map中删除 jedis.hdel("working", row); // 返回free队列 jedis.lpush("free", row); System.out.println(Thread.currentThread().getName() + " back :" + row);
} jedis.close(); } }
部分输出内容:
print free:[5, 4, 3, 2, 1] print work:[] get0 get :1 get1 get :2 get2 get :3 get2 back :3 get2 get :4 print free:[3, 5] print work:[2, 1, 4] get1 back :2 get1 get :5 get2 back :4 get1 back :5 get0 back :1 get0 get :3 print free:[1, 5, 4, 2] print work:[3] get0 back :3 print free:[3, 1, 5, 4, 2] print work:[] print free:[3, 1, 5, 4, 2] print work:[] print free:[104, 103, 102, 101, 100, 3, 1, 5, 4, 2] print work:[] print free:[104, 103, 102, 101, 100, 3, 1, 5, 4, 2] print work:[] print free:[104, 103, 102, 101, 100, 3, 1, 5, 4, 2] print work:[] print free:[104, 103, 102, 101, 100, 3, 1, 5, 4, 2] print work:[] print free:[104, 103, 102, 101, 100, 3, 1, 5, 4, 2] print work:[] print free:[104, 103, 102, 101, 100, 3, 1, 5, 4, 2] print work:[] get0 get :2 get2 get :4 get1 get :5 print free:[104, 103, 102, 101, 100, 3, 1] print work:[2, 5, 4] get0 back :2 get0 get :1 print free:[2, 104, 103, 102, 101, 100, 3] print work:[1, 5, 4] get1 back :5 get1 get :3 get2 back :4 get2 get :100 get2 back :100 print free:[100, 4, 5, 2, 104, 103, 102, 101] print work:[3, 1] get0 back :1 print free:[1, 100, 4, 5, 2, 104, 103, 102, 101] print work:[3] get1 back :3 print free:[3, 1, 100, 4, 5, 2, 104, 103, 102, 101] print work:[] print free:[3, 1, 100, 4, 5, 2, 104, 103, 102, 101] print work:[] print free:[3, 1, 100, 4, 5, 2, 104, 103, 102, 101] print work:[] print free:[3, 1, 100, 4, 5, 2, 104, 103, 102, 101] print work:[] print free:[3, 1, 100, 4, 5, 2, 104, 103, 102, 101] print work:[] print free:[3, 1, 100, 4, 5, 2, 104, 103, 102, 101] print work:[] get2 get :101 get1 get :102 get0 get :103 print free:[3, 1, 100, 4, 5, 2, 104] print work:[102, 101, 103] get2 back :101 get2 get :104 print free:[101, 3, 1, 100, 4, 5, 2] print work:[102, 104, 103] get0 back :103 get0 get :2 get0 back :2 get1 back :102 get1 get :5 print free:[102, 2, 103, 101, 3, 1, 100, 4] print work:[5, 104] get2 back :104 get1 back :5 print free:[5, 104, 102, 2, 103, 101, 3, 1, 100, 4] print work:[] print free:[5, 104, 102, 2, 103, 101, 3, 1, 100, 4] print work:[] print free:[5, 104, 102, 2, 103, 101, 3, 1, 100, 4] print work:[] print free:[5, 104, 102, 2, 103, 101, 3, 1, 100, 4] print work:[] print free:[5, 104, 102, 2, 103, 101, 3, 1, 100, 4] print work:[] print free:[5, 104, 102, 2, 103, 101, 3, 1, 100, 4] print work:[] print free:[5, 104, 102, 2, 103, 101, 3, 1, 100, 4] print work:[] get1 get :4 get2 get :100 get0 get :1 get0 back :1 get0 get :3 get1 back :4 get1 get :101 get2 back :100 get2 get :103 print free:[100, 4, 1, 5, 104, 102, 2] print work:[3, 101, 103] get0 back :3 get1 back :101 print free:[101, 3, 100, 4, 1, 5, 104, 102, 2] print work:[103] get2 back :103 print free:[103, 101, 3, 100, 4, 1, 5, 104, 102, 2] print work:[] print free:[103, 101, 3, 100, 4, 1, 5, 104, 102, 2] print work:[] print free:[103, 101, 3, 100, 4, 1, 5, 104, 102, 2] print work:[] print free:[103, 101, 3, 100, 4, 1, 5, 104, 102, 2] print work:[] print free:[103, 101, 3, 100, 4, 1, 5, 104, 102, 2] print work:[] print free:[103, 101, 3, 100, 4, 1, 5, 104, 102, 2] print work:[] print free:[103, 101, 3, 100, 4, 1, 5, 104, 102, 2] print work:[] get1 get :2 print free:[103, 101, 3, 100, 4, 1, 5, 104, 102] print work:[2] get2 get :102 get0 get :104 print free:[103, 101, 3, 100, 4, 1, 5] print work:[102, 2, 104] get1 back :2 get1 get :5 get1 back :5 print free:[5, 2, 103, 101, 3, 100, 4, 1] print work:[102, 104] get0 back :104 get0 get :1 get2 back :102 get2 get :4 get0 back :1 get2 back :4 print free:[4, 1, 102, 104, 5, 2, 103, 101, 3, 100] print work:[] print free:[4, 1, 102, 104, 5, 2, 103, 101, 3, 100] print work:[] print free:[4, 1, 102, 104, 5, 2, 103, 101, 3, 100] print work:[] print free:[4, 1, 102, 104, 5, 2, 103, 101, 3, 100] print work:[] print free:[4, 1, 102, 104, 5, 2, 103, 101, 3, 100] print work:[] print free:[4, 1, 102, 104, 5, 2, 103, 101, 3, 100] print work:[] print free:[4, 1, 102, 104, 5, 2, 103, 101, 3, 100] print work:[] get0 get :100 print free:[4, 1, 102, 104, 5, 2, 103, 101, 3] print work:[100] get2 get :3 get2 back :3 get2 get :101 get0 back :100 get0 get :103 get1 get :2 get2 back :101 print free:[101, 100, 3, 4, 1, 102, 104, 5] print work:[2, 103] get0 back :103 print free:[103, 101, 100, 3, 4, 1, 102, 104, 5] print work:[2] get1 back :2 get1 get :5 print free:[2, 103, 101, 100, 3, 4, 1, 102, 104] print work:[5] get1 back :5 print free:[5, 2, 103, 101, 100, 3, 4, 1, 102, 104] print work:[] print free:[5, 2, 103, 101, 100, 3, 4, 1, 102, 104] print work:[] print free:[5, 2, 103, 101, 100, 3, 4, 1, 102, 104] print work:[] print free:[5, 2, 103, 101, 100, 3, 4, 1, 102, 104] print work:[] print free:[5, 2, 103, 101, 100, 3, 4, 1, 102, 104] print work:[] print free:[5, 2, 103, 101, 100, 3, 4, 1, 102, 104] print work:[] print free:[5, 2, 103, 101, 100, 3, 4, 1, 102, 104] print work:[] get1 get :104 get2 get :102 get2 back :102 get2 get :1 get0 get :4 get0 back :4 get0 get :3 print free:[4, 102, 5, 2, 103, 101, 100] print work:[3, 1, 104] get2 back :1 get0 back :3 get1 back :104 get1 get :100 get1 back :100 print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] print free:[100, 104, 3, 1, 4, 102, 5, 2, 103, 101] print work:[] get0 get :101 get1 get :103 get2 get :2 get1 back :103 get1 get :5 print free:[103, 100, 104, 3, 1, 4, 102] print work:[2, 101, 5] get2 back :2 get2 get :102 print free:[2, 103, 100, 104, 3, 1, 4] print work:[102, 101, 5] get0 back :101 get0 get :4 get1 back :5 get2 back :102 get0 back :4 print free:[4, 102, 5, 101, 2, 103, 100, 104, 3, 1] print work:[] print free:[4, 102, 5, 101, 2, 103, 100, 104, 3, 1] print work:[] print free:[4, 102, 5, 101, 2, 103, 100, 104, 3, 1] print work:[] print free:[4, 102, 5, 101, 2, 103, 100, 104, 3, 1] print work:[] print free:[4, 102, 5, 101, 2, 103, 100, 104, 3, 1] print work:[] print free:[4, 102, 5, 101, 2, 103, 100, 104, 3, 1] print work:[] print free:[4, 102, 5, 101, 2, 103, 100, 104, 3, 1] print work:[] get0 get :1 get1 get :3 print free:[4, 102, 5, 101, 2, 103, 100, 104] print work:[3, 1] get2 get :104 print free:[4, 102, 5, 101, 2, 103, 100] print work:[3, 104, 1] get1 back :3 get1 get :100 get2 back :104 get2 get :103 get1 back :100 get0 back :1 get0 get :2 print free:[1, 100, 104, 3, 4, 102, 5, 101] print work:[2, 103] get2 back :103 get0 back :2 print free:[2, 103, 1, 100, 104, 3, 4, 102, 5, 101] print work:[] print free:[2, 103, 1, 100, 104, 3, 4, 102, 5, 101] print work:[] print free:[2, 103, 1, 100, 104, 3, 4, 102, 5, 101] print work:[] print free:[2, 103, 1, 100, 104, 3, 4, 102, 5, 101] print work:[] print free:[2, 103, 1, 100, 104, 3, 4, 102, 5, 101] print work:[] print free:[2, 103, 1, 100, 104, 3, 4, 102, 5, 101] print work:[] print free:[2, 103, 1, 100, 104, 3, 4, 102, 5, 101] print work:[] print free:[2, 103, 1, 100, 104, 3, 4, 102, 5, 101] print work:[] get0 get :101 get2 get :5 get1 get :102 print free:[2, 103, 1, 100, 104, 3, 4] print work:[102, 101, 5] get2 back :5 get2 get :4 get1 back :102 get1 get :3 get0 back :101 get0 get :104 print free:[101, 102, 5, 2, 103, 1, 100] print work:[3, 104, 4] get1 back :3 get0 back :104 get2 back :4 print free:[4, 104, 3, 101, 102, 5, 2, 103, 1, 100] print work:[] print free:[4, 104, 3, 101, 102, 5, 2, 103, 1, 100] print work:[] print free:[4, 104, 3, 101, 102, 5, 2, 103, 1, 100] print work:[] print free:[4, 104, 3, 101, 102, 5, 2, 103, 1, 100] print work:[] print free:[4, 104, 3, 101, 102, 5, 2, 103, 1, 100] print work:[] print free:[4, 104, 3, 101, 102, 5, 2, 103, 1, 100] print work:[] print free:[4, 104, 3, 101, 102, 5, 2, 103, 1, 100] print work:[] get0 get :100 print free:[4, 104, 3, 101, 102, 5, 2, 103, 1] print work:[100] get1 get :1 get1 back :1 get1 get :103 get2 get :2 get1 back :103 print free:[103, 1, 4, 104, 3, 101, 102, 5] print work:[100, 2] get2 back :2 get2 get :5 get2 back :5 get0 back :100 get0 get :102 print free:[100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[102] get0 back :102 print free:[102, 100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[] print free:[102, 100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[] print free:[102, 100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[] print free:[102, 100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[] print free:[102, 100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[] print free:[102, 100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[] print free:[102, 100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[] print free:[102, 100, 5, 2, 103, 1, 4, 104, 3, 101] print work:[] get2 get :101 get2 back :101 get2 get :3 get1 get :104 get0 get :4 get0 back :4 get0 get :1 print free:[4, 101, 102, 100, 5, 2, 103] print work:[3, 1, 104] get1 back :104 get1 get :103 print free:[104, 4, 101, 102, 100, 5, 2] print work:[3, 1, 103] get0 back :1 get2 back :3 print free:[3, 1, 104, 4, 101, 102, 100, 5, 2] print work:[103] get1 back :103 print free:[103, 3, 1, 104, 4, 101, 102, 100, 5, 2] print work:[] print free:[103, 3, 1, 104, 4, 101, 102, 100, 5, 2] print work:[] print free:[103, 3, 1, 104, 4, 101, 102, 100, 5, 2] print work:[] print free:[103, 3, 1, 104, 4, 101, 102, 100, 5, 2] print work:[] print free:[103, 3, 1, 104, 4, 101, 102, 100, 5, 2] print work:[] print free:[103, 3, 1, 104, 4, 101, 102, 100, 5, 2] print work:[] print free:[103, 3, 1, 104, 4, 101, 102, 100, 5, 2] print work:[] get1 get :2 get0 get :5 get2 get :100 get1 back :2 get1 get :102 print free:[2, 103, 3, 1, 104, 4, 101] print work:[102, 100, 5] get0 back :5 get0 get :101 get1 back :102 print free:[102, 5, 2, 103, 3, 1, 104, 4] print work:[100, 101] get2 back :100 get2 get :4 get0 back :101 print free:[101, 100, 102, 5, 2, 103, 3, 1, 104] print work:[4] get2 back :4 print free:[4, 101, 100, 102, 5, 2, 103, 3, 1, 104] print work:[] print free:[4, 101, 100, 102, 5, 2, 103, 3, 1, 104] print work:[] print free:[4, 101, 100, 102, 5, 2, 103, 3, 1, 104] print work:[] print free:[4, 101, 100, 102, 5, 2, 103, 3, 1, 104] print work:[] print free:[4, 101, 100, 102, 5, 2, 103, 3, 1, 104] print work:[] print free:[4, 101, 100, 102, 5, 2, 103, 3, 1, 104] print work:[] get1 get :104 print free:[4, 101, 100, 102, 5, 2, 103, 3, 1] print work:[104] get2 get :1 get0 get :3 get0 back :3 get0 get :103 print free:[3, 4, 101, 100, 102, 5, 2] print work:[1, 104, 103] get2 back :1 get2 get :2 get2 back :2 get1 back :104 get1 get :5 print free:[104, 2, 1, 3, 4, 101, 100, 102] print work:[5, 103] get0 back :103 print free:[103, 104, 2, 1, 3, 4, 101, 100, 102] print work:[5] get1 back :5 print free:[5, 103, 104, 2, 1, 3, 4, 101, 100, 102] print work:[] print free:[5, 103, 104, 2, 1, 3, 4, 101, 100, 102] print work:[] print free:[5, 103, 104, 2, 1, 3, 4, 101, 100, 102] print work:[] print free:[5, 103, 104, 2, 1, 3, 4, 101, 100, 102] print work:[] print free:[5, 103, 104, 2, 1, 3, 4, 101, 100, 102] print work:[] print free:[5, 103, 104, 2, 1, 3, 4, 101, 100, 102] print work:[] print free:[5, 103, 104, 2, 1, 3, 4, 101, 100, 102] print work:[] get1 get :102 get2 get :100 get0 get :101 print free:[5, 103, 104, 2, 1, 3, 4] print work:[102, 101, 100] get1 back :102 get1 get :4 get0 back :101 get0 get :3 print free:[101, 102, 5, 103, 104, 2, 1] print work:[3, 100, 4] get2 back :100 get2 get :1 get2 back :1 print free:[1, 100, 101, 102, 5, 103, 104, 2] print work:[3, 4] get1 back :4 get0 back :3 print free:[3, 4, 1, 100, 101, 102, 5, 103, 104, 2] print work:[] print free:[3, 4, 1, 100, 101, 102, 5, 103, 104, 2] print work:[] print free:[3, 4, 1, 100, 101, 102, 5, 103, 104, 2] print work:[] print free:[3, 4, 1, 100, 101, 102, 5, 103, 104, 2] print work:[] print free:[3, 4, 1, 100, 101, 102, 5, 103, 104, 2] print work:[] print free:[3, 4, 1, 100, 101, 102, 5, 103, 104, 2] print work:[] print free:[3, 4, 1, 100, 101, 102, 5, 103, 104, 2] print work:[] get0 get :2 get2 get :104 get1 get :103 get0 back :2 get0 get :5 get2 back :104 get2 get :102 get2 back :102 print free:[102, 104, 2, 3, 4, 1, 100, 101] print work:[5, 103] get0 back :5 get1 back :103 get1 get :101 get1 back :101 print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] print free:[101, 103, 5, 102, 104, 2, 3, 4, 1, 100] print work:[] get2 get :100 get1 get :1 get0 get :4 print free:[101, 103, 5, 102, 104, 2, 3] print work:[1, 100, 4] get2 back :100 get2 get :3 get1 back :1 get1 get :2 get2 back :3 print free:[3, 1, 100, 101, 103, 5, 102, 104] print work:[2, 4] get0 back :4 get0 get :104 get1 back :2 print free:[2, 4, 3, 1, 100, 101, 103, 5, 102] print work:[104] get0 back :104 print free:[104, 2, 4, 3, 1, 100, 101, 103, 5, 102] print work:[] print free:[104, 2, 4, 3, 1, 100, 101, 103, 5, 102] print work:[] print free:[104, 2, 4, 3, 1, 100, 101, 103, 5, 102] print work:[] print free:[104, 2, 4, 3, 1, 100, 101, 103, 5, 102] print work:[] print free:[104, 2, 4, 3, 1, 100, 101, 103, 5, 102] print work:[] print free:[104, 2, 4, 3, 1, 100, 101, 103, 5, 102] print work:[] get1 get :102 print free:[104, 2, 4, 3, 1, 100, 101, 103, 5] print work:[102] get0 get :5 get2 get :103 print free:[104, 2, 4, 3, 1, 100, 101] print work:[102, 5, 103] get1 back :102 get1 get :101 get2 back :103 get2 get :100 print free:[103, 102, 104, 2, 4, 3, 1] print work:[101, 100, 5] get0 back :5 get0 get :1 get1 back :101 print free:[101, 5, 103, 102, 104, 2, 4, 3] print work:[1, 100] get2 back :100 get0 back :1 print free:[1, 100, 101, 5, 103, 102, 104, 2, 4, 3] print work:[] print free:[1, 100, 101, 5, 103, 102, 104, 2, 4, 3] print work:[] print free:[1, 100, 101, 5, 103, 102, 104, 2, 4, 3] print work:[] print free:[1, 100, 101, 5, 103, 102, 104, 2, 4, 3] print work:[] print free:[1, 100, 101, 5, 103, 102, 104, 2, 4, 3] print work:[] print free:[1, 100, 101, 5, 103, 102, 104, 2, 4, 3] print work:[] get2 get :3 print free:[1, 100, 101, 5, 103, 102, 104, 2, 4] print work:[3] get1 get :4 get2 back :3 get2 get :2 get0 get :104 get2 back :2 get0 back :104 get0 get :102 get1 back :4 get1 get :103 print free:[4, 104, 2, 3, 1, 100, 101, 5] print work:[102, 103] get0 back :102 get1 back :103 print free:[103, 102, 4, 104, 2, 3, 1, 100, 101, 5] print work:[] print free:[103, 102, 4, 104, 2, 3, 1, 100, 101, 5] print work:[] print free:[103, 102, 4, 104, 2, 3, 1, 100, 101, 5] print work:[] print free:[103, 102, 4, 104, 2, 3, 1, 100, 101, 5] print work:[] print free:[103, 102, 4, 104, 2, 3, 1, 100, 101, 5] print work:[] print free:[103, 102, 4, 104, 2, 3, 1, 100, 101, 5] print work:[] print free:[103, 102, 4, 104, 2, 3, 1, 100, 101, 5] print work:[] print free:[103, 102, 4, 104, 2, 3, 1, 100, 101, 5] print work:[] get0 get :5 print free:[103, 102, 4, 104, 2, 3, 1, 100, 101] print work:[5] get2 get :101 get1 get :100 get1 back :100 get1 get :1 print free:[100, 103, 102, 4, 104, 2, 3] print work:[101, 1, 5] get1 back :1 get0 back :5 get0 get :3 get2 back :101 get2 get :2 print free:[101, 5, 1, 100, 103, 102, 4, 104] print work:[3, 2] get0 back :3 get2 back :2 print free:[2, 3, 101, 5, 1, 100, 103, 102, 4, 104] print work:[] print free:[2, 3, 101, 5, 1, 100, 103, 102, 4, 104] print work:[] print free:[2, 3, 101, 5, 1, 100, 103, 102, 4, 104] print work:[] print free:[2, 3, 101, 5, 1, 100, 103, 102, 4, 104] print work:[] print free:[2, 3, 101, 5, 1, 100, 103, 102, 4, 104] print work:[] print free:[2, 3, 101, 5, 1, 100, 103, 102, 4, 104] print work:[] print free:[2, 3, 101, 5, 1, 100, 103, 102, 4, 104] print work:[] get2 get :104 print free:[2, 3, 101, 5, 1, 100, 103, 102, 4] print work:[104] get1 get :4 get0 get :102 print free:[2, 3, 101, 5, 1, 100, 103] print work:[102, 104, 4] get2 back :104 get2 get :103 print free:[104, 2, 3, 101, 5, 1, 100] print work:[102, 103, 4] get0 back :102 get0 get :100 get1 back :4 get1 get :1 get2 back :103 print free:[103, 4, 102, 104, 2, 3, 101, 5] print work:[1, 100] get0 back :100 print free:[100, 103, 4, 102, 104, 2, 3, 101, 5] print work:[1] get1 back :1 print free:[1, 100, 103, 4, 102, 104, 2, 3, 101, 5] print work:[] print free:[1, 100, 103, 4, 102, 104, 2, 3, 101, 5] print work:[] print free:[1, 100, 103, 4, 102, 104, 2, 3, 101, 5] print work:[] print free:[1, 100, 103, 4, 102, 104, 2, 3, 101, 5] print work:[] print free:[1, 100, 103, 4, 102, 104, 2, 3, 101, 5] print work:[] get1 get :5 get0 get :101 get2 get :3 print free:[1, 100, 103, 4, 102, 104, 2] print work:[3, 101, 5] get1 back :5 get1 get :2 get2 back :3 get2 get :104 print free:[3, 5, 1, 100, 103, 4, 102] print work:[2, 101, 104] get1 back :2 get0 back :101 get0 get :102 print free:[101, 2, 3, 5, 1, 100, 103, 4] print work:[102, 104] get2 back :104 get0 back :102 print free:[102, 104, 101, 2, 3, 5, 1, 100, 103, 4] print work:[] print free:[102, 104, 101, 2, 3, 5, 1, 100, 103, 4] print work:[] print free:[102, 104, 101, 2, 3, 5, 1, 100, 103, 4] print work:[] print free:[102, 104, 101, 2, 3, 5, 1, 100, 103, 4] print work:[] print free:[102, 104, 101, 2, 3, 5, 1, 100, 103, 4] print work:[] print free:[102, 104, 101, 2, 3, 5, 1, 100, 103, 4] print work:[] print free:[102, 104, 101, 2, 3, 5, 1, 100, 103, 4] print work:[] get1 get :4 get2 get :103 get0 get :100 print free:[102, 104, 101, 2, 3, 5, 1] print work:[100, 103, 4] get1 back :4 get1 get :1 get2 back :103 get2 get :5 get0 back :100 get0 get :3 print free:[100, 103, 4, 102, 104, 101, 2] print work:[3, 5, 1] get0 back :3 get2 back :5 get1 back :1 print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] print free:[1, 5, 3, 100, 103, 4, 102, 104, 101, 2] print work:[] get0 get :2 get1 get :101 get1 back :101 get1 get :104 get2 get :102 print free:[101, 1, 5, 3, 100, 103, 4] print work:[102, 2, 104] get0 back :2 get0 get :4 get2 back :102 get2 get :103 print free:[102, 2, 101, 1, 5, 3, 100] print work:[104, 103, 4] get1 back :104 get2 back :103 print free:[103, 104, 102, 2, 101, 1, 5, 3, 100] print work:[4] get0 back :4 print free:[4, 103, 104, 102, 2, 101, 1, 5, 3, 100] print work:[] print free:[4, 103, 104, 102, 2, 101, 1, 5, 3, 100] print work:[] print free:[4, 103, 104, 102, 2, 101, 1, 5, 3, 100] print work:[] print free:[4, 103, 104, 102, 2, 101, 1, 5, 3, 100] print work:[] print free:[4, 103, 104, 102, 2, 101, 1, 5, 3, 100] print work:[] print free:[4, 103, 104, 102, 2, 101, 1, 5, 3, 100] print work:[] get0 get :100 print free:[4, 103, 104, 102, 2, 101, 1, 5, 3] print work:[100] get1 get :3 get0 back :100 get0 get :5 get2 get :1 get1 back :3 get1 get :101 get2 back :1 get2 get :2 get2 back :2 print free:[2, 1, 3, 100, 4, 103, 104, 102] print work:[5, 101] get0 back :5 print free:[5, 2, 1, 3, 100, 4, 103, 104, 102] print work:[101] get1 back :101 print free:[101, 5, 2, 1, 3, 100, 4, 103, 104, 102] print work:[] print free:[101, 5, 2, 1, 3, 100, 4, 103, 104, 102] print work:[] print free:[101, 5, 2, 1, 3, 100, 4, 103, 104, 102] print work:[] print free:[101, 5, 2, 1, 3, 100, 4, 103, 104, 102] print work:[] print free:[101, 5, 2, 1, 3, 100, 4, 103, 104, 102] print work:[] print free:[101, 5, 2, 1, 3, 100, 4, 103, 104, 102] print work:[] print free:[101, 5, 2, 1, 3, 100, 4, 103, 104, 102] print work:[] get2 get :102 get0 get :104 print free:[101, 5, 2, 1, 3, 100, 4, 103] print work:[102, 104] get1 get :103 get1 back :103 get1 get :4 get2 back :102 get2 get :100 print free:[102, 103, 101, 5, 2, 1, 3] print work:[100, 104, 4] get1 back :4 get0 back :104 get0 get :3 print free:[104, 4, 102, 103, 101, 5, 2, 1] print work:[3, 100] get2 back :100 print free:[100, 104, 4, 102, 103, 101, 5, 2, 1] print work:[3] get0 back :3 print free:[3, 100, 104, 4, 102, 103, 101, 5, 2, 1] print work:[] print free:[3, 100, 104, 4, 102, 103, 101, 5, 2, 1] print work:[] print free:[3, 100, 104, 4, 102, 103, 101, 5, 2, 1] print work:[] print free:[3, 100, 104, 4, 102, 103, 101, 5, 2, 1] print work:[] print free:[3, 100, 104, 4, 102, 103, 101, 5, 2, 1] print work:[] print free:[3, 100, 104, 4, 102, 103, 101, 5, 2, 1] print work:[] get0 get :1 get1 get :2 get2 get :5 print free:[3, 100, 104, 4, 102, 103, 101] print work:[2, 5, 1] get0 back :1 get0 get :101 get1 back :2 get1 get :103 print free:[2, 1, 3, 100, 104, 4, 102] print work:[101, 5, 103] get0 back :101 get2 back :5 get2 get :102 get1 back :103 print free:[103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[102] get2 back :102 print free:[102, 103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[] print free:[102, 103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[] print free:[102, 103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[] print free:[102, 103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[] print free:[102, 103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[] print free:[102, 103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[] print free:[102, 103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[] print free:[102, 103, 5, 101, 2, 1, 3, 100, 104, 4] print work:[] get1 get :4 get2 get :104 get0 get :100 get0 back :100 get0 get :3 print free:[100, 102, 103, 5, 101, 2, 1] print work:[3, 104, 4] get2 back :104 get2 get :1 get1 back :4 get1 get :2 get1 back :2 get0 back :3 print free:[3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[1] get2 back :1 print free:[1, 3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[] print free:[1, 3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[] print free:[1, 3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[] print free:[1, 3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[] print free:[1, 3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[] print free:[1, 3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[] print free:[1, 3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[] print free:[1, 3, 2, 4, 104, 100, 102, 103, 5, 101] print work:[] get1 get :101 get2 get :5 get0 get :103 get2 back :5 get2 get :102 get1 back :101 get1 get :100 get0 back :103 get0 get :104 print free:[103, 101, 5, 1, 3, 2, 4] print work:[102, 104, 100] get2 back :102 get1 back :100 get0 back :104 print free:[104, 100, 102, 103, 101, 5, 1, 3, 2, 4] print work:[] print free:[104, 100, 102, 103, 101, 5, 1, 3, 2, 4] print work:[] print free:[104, 100, 102, 103, 101, 5, 1, 3, 2, 4] print work:[] print free:[104, 100, 102, 103, 101, 5, 1, 3, 2, 4] print work:[] print free:[104, 100, 102, 103, 101, 5, 1, 3, 2, 4] print work:[] print free:[104, 100, 102, 103, 101, 5, 1, 3, 2, 4] print work:[] print free:[104, 100, 102, 103, 101, 5, 1, 3, 2, 4] print work:[] print free:[104, 100, 102, 103, 101, 5, 1, 3, 2, 4] print work:[] get2 get :4 get2 back :4 get2 get :2 print free:[4, 104, 100, 102, 103, 101, 5, 1, 3] print work:[2] get0 get :3 get1 get :1 print free:[4, 104, 100, 102, 103, 101, 5] print work:[3, 2, 1] get1 back :1 get1 get :5 get2 back :2 get0 back :3 get0 get :101 print free:[3, 2, 1, 4, 104, 100, 102, 103] print work:[5, 101] print free:[3, 2, 1, 4, 104, 100, 102, 103] print work:[5, 101] get1 back :5 get0 back :101 print free:[101, 5, 3, 2, 1, 4, 104, 100, 102, 103] print work:[] print free:[101, 5, 3, 2, 1, 4, 104, 100, 102, 103] print work:[] print free:[101, 5, 3, 2, 1, 4, 104, 100, 102, 103] print work:[] print free:[101, 5, 3, 2, 1, 4, 104, 100, 102, 103] print work:[] print free:[101, 5, 3, 2, 1, 4, 104, 100, 102, 103] print work:[] print free:[101, 5, 3, 2, 1, 4, 104, 100, 102, 103] print work:[] get2 get :103 get2 back :103 get2 get :102 print free:[103, 101, 5, 3, 2, 1, 4, 104, 100] print work:[102] get1 get :100 get0 get :104 get2 back :102 get0 back :104 get0 get :4 print free:[104, 102, 103, 101, 5, 3, 2, 1] print work:[100, 4] get1 back :100 get1 get :1 print free:[100, 104, 102, 103, 101, 5, 3, 2] print work:[1, 4] get0 back :4 print free:[4, 100, 104, 102, 103, 101, 5, 3, 2] print work:[1] get1 back :1 print free:[1, 4, 100, 104, 102, 103, 101, 5, 3, 2] print work:[] print free:[1, 4, 100, 104, 102, 103, 101, 5, 3, 2] print work:[] print free:[1, 4, 100, 104, 102, 103, 101, 5, 3, 2] print work:[] print free:[1, 4, 100, 104, 102, 103, 101, 5, 3, 2] print work:[] print free:[1, 4, 100, 104, 102, 103, 101, 5, 3, 2] print work:[] print free:[1, 4, 100, 104, 102, 103, 101, 5, 3, 2] print work:[] print free:[1, 4, 100, 104, 102, 103, 101, 5, 3, 2] print work:[] get2 get :2 get1 get :3 get0 get :5 get2 back :2 get2 get :101 get0 back :5 get0 get :103 print free:[5, 2, 1, 4, 100, 104, 102] print work:[3, 101, 103] get1 back :3 get1 get :102 get2 back :101 get0 back :103 get1 back :102 print free:[102, 103, 101, 3, 5, 2, 1, 4, 100, 104] print work:[] print free:[102, 103, 101, 3, 5, 2, 1, 4, 100, 104] print work:[] print free:[102, 103, 101, 3, 5, 2, 1, 4, 100, 104] print work:[] print free:[102, 103, 101, 3, 5, 2, 1, 4, 100, 104] print work:[] print free:[102, 103, 101, 3, 5, 2, 1, 4, 100, 104] print work:[] print free:[102, 103, 101, 3, 5, 2, 1, 4, 100, 104] print work:[] print free:[102, 103, 101, 3, 5, 2, 1, 4, 100, 104] print work:[] print free:[102, 103, 101, 3, 5, 2, 1, 4, 100, 104] print work:[] get0 get :104 print free:[102, 103, 101, 3, 5, 2, 1, 4, 100] print work:[104] get2 get :100 get1 get :4 get1 back :4 get1 get :1 print free:[4, 102, 103, 101, 3, 5, 2] print work:[1, 100, 104] get0 back :104 get0 get :2 get1 back :1 get2 back :100 get2 get :5 print free:[100, 1, 104, 4, 102, 103, 101, 3] print work:[5, 2] get2 back :5 get0 back :2 print free:[2, 5, 100, 1, 104, 4, 102, 103, 101, 3] print work:[] print free:[2, 5, 100, 1, 104, 4, 102, 103, 101, 3] print work:[] print free:[2, 5, 100, 1, 104, 4, 102, 103, 101, 3] print work:[] print free:[2, 5, 100, 1, 104, 4, 102, 103, 101, 3] print work:[] print free:[2, 5, 100, 1, 104, 4, 102, 103, 101, 3] print work:[] print free:[2, 5, 100, 1, 104, 4, 102, 103, 101, 3] print work:[] print free:[2, 5, 100, 1, 104, 4, 102, 103, 101, 3] print work:[] print free:[2, 5, 100, 1, 104, 4, 102, 103, 101, 3] print work:[] get2 get :3 get0 get :101 get1 get :103 get0 back :101 get0 get :102 get0 back :102 print free:[102, 101, 2, 5, 100, 1, 104, 4] print work:[3, 103] get1 back :103 get1 get :4 get2 back :3 get2 get :104 print free:[3, 103, 102, 101, 2, 5, 100, 1] print work:[104, 4] print free:[3, 103, 102, 101, 2, 5, 100, 1] print work:[104, 4] get1 back :4 get2 back :104 print free:[104, 4, 3, 103, 102, 101, 2, 5, 100, 1] print work:[] print free:[104, 4, 3, 103, 102, 101, 2, 5, 100, 1] print work:[] print free:[104, 4, 3, 103, 102, 101, 2, 5, 100, 1] print work:[] print free:[104, 4, 3, 103, 102, 101, 2, 5, 100, 1] print work:[] print free:[104, 4, 3, 103, 102, 101, 2, 5, 100, 1] print work:[] print free:[104, 4, 3, 103, 102, 101, 2, 5, 100, 1] print work:[] get1 get :1 print free:[104, 4, 3, 103, 102, 101, 2, 5, 100] print work:[1] get0 get :100 get1 back :1 get1 get :5 get2 get :2 get2 back :2 get2 get :101 get1 back :5 print free:[5, 2, 1, 104, 4, 3, 103, 102] print work:[100, 101] get2 back :101 get0 back :100 get0 get :102 print free:[100, 101, 5, 2, 1, 104, 4, 3, 103] print work:[102] get0 back :102 print free:[102, 100, 101, 5, 2, 1, 104, 4, 3, 103] print work:[] print free:[102, 100, 101, 5, 2, 1, 104, 4, 3, 103] print work:[] print free:[102, 100, 101, 5, 2, 1, 104, 4, 3, 103] print work:[] print free:[102, 100, 101, 5, 2, 1, 104, 4, 3, 103] print work:[] print free:[102, 100, 101, 5, 2, 1, 104, 4, 3, 103] print work:[] print free:[102, 100, 101, 5, 2, 1, 104, 4, 3, 103] print work:[] print free:[102, 100, 101, 5, 2, 1, 104, 4, 3, 103] print work:[] get0 get :103 print free:[102, 100, 101, 5, 2, 1, 104, 4, 3] get2 get :3 print work:[103] get1 get :4 get2 back :3 get2 get :104 print free:[3, 102, 100, 101, 5, 2, 1] print work:[104, 4, 103] get0 back :103 get0 get :1 print free:[103, 3, 102, 100, 101, 5, 2] print work:[1, 104, 4] get1 back :4 get1 get :2 get2 back :104 get0 back :1 print free:[1, 104, 4, 103, 3, 102, 100, 101, 5] print work:[2] get1 back :2 print free:[2, 1, 104, 4, 103, 3, 102, 100, 101, 5] print work:[] print free:[2, 1, 104, 4, 103, 3, 102, 100, 101, 5] print work:[] print free:[2, 1, 104, 4, 103, 3, 102, 100, 101, 5] print work:[] print free:[2, 1, 104, 4, 103, 3, 102, 100, 101, 5] print work:[] print free:[2, 1, 104, 4, 103, 3, 102, 100, 101, 5] print work:[] print free:[2, 1, 104, 4, 103, 3, 102, 100, 101, 5] print work:[] get2 get :5 print free:[2, 1, 104, 4, 103, 3, 102, 100, 101] print work:[5] get1 get :101 get1 back :101 get1 get :100 get2 back :5 get2 get :102 get0 get :3 print free:[5, 101, 2, 1, 104, 4, 103] print work:[3, 102, 100] get1 back :100 get2 back :102 print free:[102, 100, 5, 101, 2, 1, 104, 4, 103] print work:[3] get0 back :3 get0 get :103 get0 back :103 print free:[103, 3, 102, 100, 5, 101, 2, 1, 104, 4] print work:[] print free:[103, 3, 102, 100, 5, 101, 2, 1, 104, 4] print work:[] print free:[103, 3, 102, 100, 5, 101, 2, 1, 104, 4] print work:[] print free:[103, 3, 102, 100, 5, 101, 2, 1, 104, 4] print work:[] print free:[103, 3, 102, 100, 5, 101, 2, 1, 104, 4] print work:[] print free:[103, 3, 102, 100, 5, 101, 2, 1, 104, 4] print work:[] print free:[103, 3, 102, 100, 5, 101, 2, 1, 104, 4] print work:[] get2 get :4 print free:[103, 3, 102, 100, 5, 101, 2, 1, 104] print work:[4] get0 get :104 get2 back :4 get2 get :1 get1 get :2 get0 back :104 get0 get :101 get1 back :2 get1 get :5 print free:[2, 104, 4, 103, 3, 102, 100] print work:[101, 5, 1] get1 back :5 get0 back :101 get2 back :1 print free:[1, 101, 5, 2, 104, 4, 103, 3, 102, 100] print work:[] print free:[1, 101, 5, 2, 104, 4, 103, 3, 102, 100] print work:[] print free:[1, 101, 5, 2, 104, 4, 103, 3, 102, 100] print work:[] print free:[1, 101, 5, 2, 104, 4, 103, 3, 102, 100] print work:[] print free:[1, 101, 5, 2, 104, 4, 103, 3, 102, 100] print work:[] print free:[1, 101, 5, 2, 104, 4, 103, 3, 102, 100] print work:[] print free:[1, 101, 5, 2, 104, 4, 103, 3, 102, 100] print work:[] print free:[1, 101, 5, 2, 104, 4, 103, 3, 102, 100] print work:[] get0 get :100 print free:[1, 101, 5, 2, 104, 4, 103, 3, 102] print work:[100] get2 get :102 get1 get :3 get0 back :100 get0 get :103 print free:[100, 1, 101, 5, 2, 104, 4] print work:[3, 102, 103] get0 back :103 get2 back :102 get2 get :4 print free:[102, 103, 100, 1, 101, 5, 2, 104] print work:[3, 4] get1 back :3 get1 get :104 print free:[3, 102, 103, 100, 1, 101, 5, 2] print work:[104, 4] get1 back :104 get2 back :4 print free:[4, 104, 3, 102, 103, 100, 1, 101, 5, 2] print work:[] print free:[4, 104, 3, 102, 103, 100, 1, 101, 5, 2] print work:[] print free:[4, 104, 3, 102, 103, 100, 1, 101, 5, 2] print work:[] print free:[4, 104, 3, 102, 103, 100, 1, 101, 5, 2] print work:[] print free:[4, 104, 3, 102, 103, 100, 1, 101, 5, 2] print work:[] print free:[4, 104, 3, 102, 103, 100, 1, 101, 5, 2] print work:[] get0 get :2 get2 get :5 get1 get :101 get1 back :101 get1 get :1 print free:[101, 4, 104, 3, 102, 103, 100] print work:[2, 1, 5] get0 back :2 get0 get :100 get0 back :100 print free:[100, 2, 101, 4, 104, 3, 102, 103] print work:[1, 5] get2 back :5 get2 get :103 get1 back :1 print free:[1, 5, 100, 2, 101, 4, 104, 3, 102] print work:[103] print free:[1, 5, 100, 2, 101, 4, 104, 3, 102] print work:[103] get2 back :103 print free:[103, 1, 5, 100, 2, 101, 4, 104, 3, 102] print work:[] print free:[103, 1, 5, 100, 2, 101, 4, 104, 3, 102] print work:[] print free:[103, 1, 5, 100, 2, 101, 4, 104, 3, 102] print work:[] print free:[103, 1, 5, 100, 2, 101, 4, 104, 3, 102] print work:[] print free:[103, 1, 5, 100, 2, 101, 4, 104, 3, 102] print work:[] print free:[103, 1, 5, 100, 2, 101, 4, 104, 3, 102] print work:[] get0 get :102 get2 get :3 print free:[103, 1, 5, 100, 2, 101, 4, 104] print work:[3, 102] get1 get :104 get0 back :102 get0 get :4 get2 back :3 get2 get :101 get1 back :104 get1 get :2 print free:[104, 3, 102, 103, 1, 5, 100] print work:[2, 101, 4] get2 back :101 print free:[101, 104, 3, 102, 103, 1, 5, 100] print work:[2, 4] get1 back :2 get0 back :4 print free:[4, 2, 101, 104, 3, 102, 103, 1, 5, 100] print work:[] print free:[4, 2, 101, 104, 3, 102, 103, 1, 5, 100] print work:[] print free:[4, 2, 101, 104, 3, 102, 103, 1, 5, 100] print work:[] print free:[4, 2, 101, 104, 3, 102, 103, 1, 5, 100] print work:[] print free:[4, 2, 101, 104, 3, 102, 103, 1, 5, 100] print work:[] print free:[4, 2, 101, 104, 3, 102, 103, 1, 5, 100] print work:[] print free:[4, 2, 101, 104, 3, 102, 103, 1, 5, 100] print work:[] get2 get :100 get0 get :5 get0 back :5 get0 get :1 print free:[5, 4, 2, 101, 104, 3, 102, 103] print work:[1, 100] get1 get :103 get2 back :100 get2 get :102 get1 back :103 get1 get :3 print free:[103, 100, 5, 4, 2, 101, 104] print work:[3, 102, 1] get0 back :1 get1 back :3 print free:[3, 1, 103, 100, 5, 4, 2, 101, 104] print work:[102] get2 back :102 print free:[102, 3, 1, 103, 100, 5, 4, 2, 101, 104] print work:[] print free:[102, 3, 1, 103, 100, 5, 4, 2, 101, 104] print work:[] print free:[102, 3, 1, 103, 100, 5, 4, 2, 101, 104] print work:[] print free:[102, 3, 1, 103, 100, 5, 4, 2, 101, 104] print work:[] print free:[102, 3, 1, 103, 100, 5, 4, 2, 101, 104] print work:[] print free:[102, 3, 1, 103, 100, 5, 4, 2, 101, 104] print work:[] print free:[102, 3, 1, 103, 100, 5, 4, 2, 101, 104] print work:[] get0 get :104 print free:[102, 3, 1, 103, 100, 5, 4, 2, 101] print work:[104] get1 get :101 get2 get :2 get2 back :2 get2 get :4 get0 back :104 get0 get :5 get1 back :101 get1 get :100 print free:[101, 104, 2, 102, 3, 1, 103] print work:[100, 5, 4] get2 back :4 get1 back :100 print free:[100, 4, 101, 104, 2, 102, 3, 1, 103] print work:[5] get0 back :5 print free:[5, 100, 4, 101, 104, 2, 102, 3, 1, 103] print work:[] print free:[5, 100, 4, 101, 104, 2, 102, 3, 1, 103] print work:[] print free:[5, 100, 4, 101, 104, 2, 102, 3, 1, 103] print work:[] print free:[5, 100, 4, 101, 104, 2, 102, 3, 1, 103] print work:[] print free:[5, 100, 4, 101, 104, 2, 102, 3, 1, 103] print work:[] print free:[5, 100, 4, 101, 104, 2, 102, 3, 1, 103] print work:[] print free:[5, 100, 4, 101, 104, 2, 102, 3, 1, 103] print work:[] get2 get :103 get1 get :1 print free:[5, 100, 4, 101, 104, 2, 102, 3] print work:[1, 103] get0 get :3 get1 back :1 get1 get :102 get2 back :103 get2 get :2 get2 back :2 print free:[2, 103, 1, 5, 100, 4, 101, 104] print work:[102, 3] print free:[2, 103, 1, 5, 100, 4, 101, 104] print work:[102, 3] get1 back :102 get0 back :3 get0 get :104 print free:[3, 102, 2, 103, 1, 5, 100, 4, 101] print work:[104] get0 back :104 print free:[104, 3, 102, 2, 103, 1, 5, 100, 4, 101] print work:[] print free:[104, 3, 102, 2, 103, 1, 5, 100, 4, 101] print work:[] print free:[104, 3, 102, 2, 103, 1, 5, 100, 4, 101] print work:[] print free:[104, 3, 102, 2, 103, 1, 5, 100, 4, 101] print work:[] print free:[104, 3, 102, 2, 103, 1, 5, 100, 4, 101] print work:[] print free:[104, 3, 102, 2, 103, 1, 5, 100, 4, 101] print work:[] get2 get :101 get1 get :4 print free:[104, 3, 102, 2, 103, 1, 5, 100] print work:[101, 4] get0 get :100 get2 back :101 get2 get :5 get1 back :4 get1 get :1 print free:[4, 101, 104, 3, 102, 2, 103] print work:[1, 5, 100] get2 back :5 get0 back :100 get0 get :103 print free:[100, 5, 4, 101, 104, 3, 102, 2] print work:[1, 103] get1 back :1 get0 back :103 print free:[103, 1, 100, 5, 4, 101, 104, 3, 102, 2] print work:[] print free:[103, 1, 100, 5, 4, 101, 104, 3, 102, 2] print work:[] print free:[103, 1, 100, 5, 4, 101, 104, 3, 102, 2] print work:[] print free:[103, 1, 100, 5, 4, 101, 104, 3, 102, 2] print work:[] print free:[103, 1, 100, 5, 4, 101, 104, 3, 102, 2] print work:[] print free:[103, 1, 100, 5, 4, 101, 104, 3, 102, 2] print work:[] print free:[103, 1, 100, 5, 4, 101, 104, 3, 102, 2] print work:[] get0 get :2 get2 get :102 print free:[103, 1, 100, 5, 4, 101, 104, 3] print work:[102, 2] get1 get :3 get2 back :102 get2 get :104 get0 back :2 get0 get :101 get2 back :104 get1 back :3 get1 get :4 print free:[3, 104, 2, 102, 103, 1, 100, 5] print work:[101, 4] get1 back :4 get0 back :101 print free:[101, 4, 3, 104, 2, 102, 103, 1, 100, 5] print work:[] print free:[101, 4, 3, 104, 2, 102, 103, 1, 100, 5] print work:[] print free:[101, 4, 3, 104, 2, 102, 103, 1, 100, 5] print work:[] print free:[101, 4, 3, 104, 2, 102, 103, 1, 100, 5] print work:[] print free:[101, 4, 3, 104, 2, 102, 103, 1, 100, 5] print work:[] print free:[101, 4, 3, 104, 2, 102, 103, 1, 100, 5] print work:[] print free:[101, 4, 3, 104, 2, 102, 103, 1, 100, 5] print work:[] print free:[101, 4, 3, 104, 2, 102, 103, 1, 100, 5] print work:[] get2 get :5 get0 get :100 get1 get :1 print free:[101, 4, 3, 104, 2, 102, 103] print work:[1, 100, 5] get1 back :1 get1 get :103 get2 back :5 get2 get :102 get2 back :102 print free:[102, 5, 1, 101, 4, 3, 104, 2] print work:[100, 103] get1 back :103 get0 back :100 get0 get :2 print free:[100, 103, 102, 5, 1, 101, 4, 3, 104] print work:[2] print free:[100, 103, 102, 5, 1, 101, 4, 3, 104] print work:[2] get0 back :2 print free:[2, 100, 103, 102, 5, 1, 101, 4, 3, 104] print work:[] print free:[2, 100, 103, 102, 5, 1, 101, 4, 3, 104] print work:[] print free:[2, 100, 103, 102, 5, 1, 101, 4, 3, 104] print work:[] print free:[2, 100, 103, 102, 5, 1, 101, 4, 3, 104] print work:[] print free:[2, 100, 103, 102, 5, 1, 101, 4, 3, 104] print work:[] print free:[2, 100, 103, 102, 5, 1, 101, 4, 3, 104] print work:[] get0 get :104 print free:[2, 100, 103, 102, 5, 1, 101, 4, 3] print work:[104] get1 get :3 get0 back :104 get0 get :4 get2 get :101 print free:[104, 2, 100, 103, 102, 5, 1] print work:[3, 101, 4] get1 back :3 get1 get :1 get0 back :4 get1 back :1 print free:[1, 4, 3, 104, 2, 100, 103, 102, 5] print work:[101] get2 back :101 get2 get :5 print free:[101, 1, 4, 3, 104, 2, 100, 103, 102] print work:[5] print free:[101, 1, 4, 3, 104, 2, 100, 103, 102] print work:[5] get2 back :5 print free:[5, 101, 1, 4, 3, 104, 2, 100, 103, 102] print work:[] print free:[5, 101, 1, 4, 3, 104, 2, 100, 103, 102] print work:[] print free:[5, 101, 1, 4, 3, 104, 2, 100, 103, 102] print work:[] print free:[5, 101, 1, 4, 3, 104, 2, 100, 103, 102] print work:[] print free:[5, 101, 1, 4, 3, 104, 2, 100, 103, 102] print work:[] get0 get :102 print free:[5, 101, 1, 4, 3, 104, 2, 100, 103] print work:[102] get2 get :103 get2 back :103 get2 get :100 get1 get :2 get0 back :102 get0 get :104 get2 back :100 print free:[100, 102, 103, 5, 101, 1, 4, 3] print work:[104, 2] get1 back :2 get1 get :3 get0 back :104 print free:[104, 2, 100, 102, 103, 5, 101, 1, 4] print work:[3] get1 back :3 print free:[3, 104, 2, 100, 102, 103, 5, 101, 1, 4] print work:[] print free:[3, 104, 2, 100, 102, 103, 5, 101, 1, 4] print work:[] print free:[3, 104, 2, 100, 102, 103, 5, 101, 1, 4] print work:[] print free:[3, 104, 2, 100, 102, 103, 5, 101, 1, 4] print work:[] print free:[3, 104, 2, 100, 102, 103, 5, 101, 1, 4] print work:[] print free:[3, 104, 2, 100, 102, 103, 5, 101, 1, 4] print work:[] print free:[3, 104, 2, 100, 102, 103, 5, 101, 1, 4] print work:[] get1 get :4 get0 get :1 print free:[3, 104, 2, 100, 102, 103, 5, 101] print work:[1, 4] get2 get :101 print free:[3, 104, 2, 100, 102, 103, 5] print work:[101, 1, 4] get0 back :1 get0 get :5 get1 back :4 get1 get :103 get1 back :103 print free:[103, 4, 1, 3, 104, 2, 100, 102] print work:[5, 101] get0 back :5 get2 back :101 get2 get :102 get2 back :102 print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[] print free:[102, 101, 5, 103, 4, 1, 3, 104, 2, 100] print work:[]
|