Paulundra is playing a multiplayer shooter called Counter-rant. Recently Counter-rant launched a new season of the Battle Pass where you can get n of the m available weapon skins. The skin opening system is unusual: the player is given n runes, to use the rune, you need to insert two crystals of fixed colors into it, after which if the rune fits the weapon, the weapon opens. A rune matches a weapon if the weapon contains both colors contained in the rune. Each weapon skin contains exactly C colors.
The Battle Pass consists of k levels. For each level of the Battle Pass, exactly one crystal is given, for each level the reward is known in advance. For reaching level i, the reward will be a crystal with the color ai. The player uses the crystals at his own discretion: inserts into any of the runes or does not use the crystal at all. Since it's hard to earn levels, Paulundra wants to know what is the minimum number of Battle Pass levels she needs to unlock in order to get at least p skins, assuming she distributes crystals and runes optimally.
The first line of the input contains five numbers m, C, n, p and k. This is followed by m lines containing C numbers cij each describing the colors of weapon skins with number i. The next n lines contain two numbers each ai1 and ai2 — rune descriptions. The last line of the input contains k number Si, where Si is the color of the crystal for getting level i
Print a single integer — the minimum number of levels you need to get to open at least p skins. If p skins cannot be opened print -1.
1 ≤ m ≤ 100
2 ≤ C ≤ 10
1 ≤ n, p ≤ 10
1 ≤ k ≤ 106
1 ≤ ai1, ai2, Si, cij ≤ 109
ai1 ≠ ai2