Digital collectible card games have become very popular recently. So Vova decided to try one of these.
Vova has _n_ cards in his collection. Each of these cards is characterised by its power _p__i_, magic number _c__i_ and level _l__i_. Vova wants to build a deck with total power not less than _k_, but magic numbers may not allow him to do so — Vova can't place two cards in a deck if the sum of the magic numbers written on these cards is a prime number. Also Vova cannot use a card if its level is greater than the level of Vova's character.
At the moment Vova's character's level is 1. Help Vova to determine the minimum level he needs to reach in order to build a deck with the required total power.
## Input
The first line contains two integers _n_ and _k_ (1 ≤ _n_ ≤ 100, 1 ≤ _k_ ≤ 100000).
Then _n_ lines follow, each of these lines contains three numbers that represent the corresponding card: _p__i_, _c__i_ and _l__i_ (1 ≤ _p__i_ ≤ 1000, 1 ≤ _c__i_ ≤ 100000, 1 ≤ _l__i_ ≤ _n_).
## Output
If Vova won't be able to build a deck with required power, print - 1. Otherwise print the minimum level Vova has to reach in order to build a deck.
[samples]
近年来,数字收藏卡牌游戏变得非常流行。因此,Vova 决定尝试其中一款。
Vova 在他的收藏中拥有 #cf_span[n] 张卡牌。每张卡牌由其力量 #cf_span[pi]、魔法值 #cf_span[ci] 和等级 #cf_span[li] 描述。Vova 希望建立一个总力量不小于 #cf_span[k] 的牌组,但魔法值可能会阻止他这样做——如果两张卡牌的魔法值之和为质数,则 Vova 不能将这两张卡牌同时放入牌组中。此外,如果一张卡牌的等级大于 Vova 角色的等级,则 Vova 不能使用该卡牌。
目前,Vova 角色的等级为 #cf_span[1]。请帮助 Vova 确定他需要达到的最低等级,以便构建一个满足所需总力量的牌组。
第一行包含两个整数 #cf_span[n] 和 #cf_span[k](#cf_span[1 ≤ n ≤ 100],#cf_span[1 ≤ k ≤ 100000])。
接下来 #cf_span[n] 行,每行包含三个数字,表示对应卡牌的 #cf_span[pi]、#cf_span[ci] 和 #cf_span[li](#cf_span[1 ≤ pi ≤ 1000],#cf_span[1 ≤ ci ≤ 100000],#cf_span[1 ≤ li ≤ n])。
如果 Vova 无法构建出满足所需力量的牌组,请输出 #cf_span[ - 1]。否则,请输出 Vova 需要达到的最低等级。
## Input
第一行包含两个整数 #cf_span[n] 和 #cf_span[k](#cf_span[1 ≤ n ≤ 100],#cf_span[1 ≤ k ≤ 100000])。接下来 #cf_span[n] 行,每行包含三个数字,表示对应卡牌的 #cf_span[pi]、#cf_span[ci] 和 #cf_span[li](#cf_span[1 ≤ pi ≤ 1000],#cf_span[1 ≤ ci ≤ 100000],#cf_span[1 ≤ li ≤ n])。
## Output
如果 Vova 无法构建出满足所需力量的牌组,请输出 #cf_span[ - 1]。否则,请输出 Vova 需要达到的最低等级。
[samples]
**Definitions**
Let $ n, k \in \mathbb{Z}^+ $.
Let $ C = \{ (p_i, c_i, l_i) \mid i \in \{1, \dots, n\} \} $ be the set of cards, where:
- $ p_i \in \mathbb{Z}^+ $ is the power of card $ i $,
- $ c_i \in \mathbb{Z}^+ $ is the magic number of card $ i $,
- $ l_i \in \mathbb{Z}^+ $ is the level requirement of card $ i $.
Let $ S \subseteq C $ be a subset of cards (a deck).
Define the total power of $ S $ as $ P(S) = \sum_{(p_i, c_i, l_i) \in S} p_i $.
Let $ \text{Prime} \subset \mathbb{Z}^+ $ be the set of prime numbers.
**Constraints**
1. For any two distinct cards $ (p_i, c_i, l_i), (p_j, c_j, l_j) \in S $, it holds that $ c_i + c_j \notin \text{Prime} $.
2. For all $ (p_i, c_i, l_i) \in S $, $ l_i \leq L $, where $ L \in \mathbb{Z}^+ $ is the character's level.
3. $ P(S) \geq k $.
**Objective**
Find the minimum $ L \in \{1, \dots, n\} $ such that there exists a subset $ S \subseteq \{ (p_i, c_i, l_i) \in C \mid l_i \leq L \} $ satisfying:
- $ \forall (p_i, c_i, l_i), (p_j, c_j, l_j) \in S, i \ne j $: $ c_i + c_j \notin \text{Prime} $,
- $ P(S) \geq k $.
If no such $ L $ exists, output $ -1 $.