511002 - 组成最小数

【题目描述】组成最小数 (captive)

给n1个1,n2个2,n3个5,问它们不能组成的最小正整数是多少?

Input

包括多组数据,每组数据包含三个整数,即n1,n2,n3(0≤n1,n2,n3≤1000),最后以0 0 0结束全部数据。

Output

输出不能组成的最小正整数。

Examples

Input

1 1 3
0 0 0

Output

4
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题