Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies.

At first, Arya and Bran have 0 Candies. There are n days, at the i-th day, Arya finds ai candies in a box, that is given by the Many-Faced God. Every day she can give Bran at most 8 of her candies. If she don't give him the candies at the same day, they are saved for her and she can give them to him later.

Your task is to find the minimum number of days Arya needs to give Bran k candies before the end of the n-th day. Formally, you need to output the minimum day index to the end of which k candies will be given out (the days are indexed from 1 to n).

Print -1 if she can't give him k candies during n given days.

Input

The first line contains two integers n and k (1 ≤ n ≤ 100, 1 ≤ k ≤ 10000).

The second line contains n integers a1, a2, a3, ..., an (1 ≤ ai ≤ 100).

Output

If it is impossible for Arya to give Bran k candies within n days, print -1.

Otherwise print a single integer — the minimum number of days Arya needs to give Bran k candies before the end of the n-th day.

Examples

Input

2 3
1 2


Output

2

Input

3 17
10 10 10


Output

3

Input

1 9
10


Output

-1

Note

In the first sample, Arya can give Bran 3 candies in 2 days.

In the second sample, Arya can give Bran 17 candies in 3 days, because she can give him at most 8 candies per day.

In the third sample, Arya can't give Bran 9 candies, because she can give him at most 8 candies per day and she must give him the candies within 1 day.


import java.io.*;
import java.util.*;
import java.util.concurrent.BrokenBarrierException;

import javax.swing.text.html.MinimalHTMLWriter;

import static java.lang.Math.abs;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.sqrt;

public class Main {


    public static void main(String [] args){
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Integer readFromFile=new Integer(1);
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskD {
        void madAdd(Map <Integer, Integer> map, int value){
            if(map.containsKey(value)){
                map.put(value, map.get(value)+1);
            }else{
                map.put(value, 1);
            }
        }
        //I have to try at least two ways to solve this problem, I'll make one of them with ;
        class Pair implements Comparable<Pair>{
            int fist;
            int second;
            Pair(int fist, int second){
                this.fist = fist;
                this.second = second;
            }
            @Override
            public int compareTo(Pair arg0) {
                return fist-arg0.fist;
            }
        }
        int _gdc(int a, int b){
            if(a%b==0){
                return b;
            }else{
                return gdc(b, a%b);
            }
        }
        int gdc(int a, int b){
            if(a>=b){
                return _gdc(a, b);
            }else{
                return _gdc(b, a);
            }
        }
        boolean isPassedF(int []array, int c){
            boolean isPassed = false;
            long sum=0;
            for(int i=0, sum1=c; i<array.length-1; i++){
                if(sum1+array[i]-array[i+1]<0){
                    isPassed=true;
                    break;
                }else{
                    sum1+=array[i]-array[i+1];
                }
            }
            return isPassed;
        }
        int pow(int a, int n){
            int result = 1;
            for(int i=0; i<n; i++){
                result*=a;
            }
            return result;
        }
        void eratos(byte []primeNum){
            int size = primeNum.length;
            for(int i=2; i*i<size; i++){
                if(primeNum[i]==0){
                    for(int j=i+i; j<size; j+=i){
                        primeNum[j]=1;
                    }
                }
            }
        }
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n  = in.nextInt();
            int k = in.nextInt();
            boolean isAnswer = false;
            for(int i=0, alreadyHave = 0, rest=0; i<n; i++){
                int countCandle = in.nextInt();
                rest+=countCandle;
                if(rest<=8){
                    alreadyHave+=rest;
                    rest = 0;
                }else{
                    alreadyHave+=8;
                    rest-=8;
                }
                if(alreadyHave>=k && isAnswer==false){
                    out.print(i+1);
                    isAnswer = true;
                }
            }
            if(isAnswer==false){
                out.print(-1);
            }
        }
    }

    static class InputReader {
        BufferedReader br;
        StringTokenizer st;
        String st1;
        File file = new File("text.txt");
        public InputReader(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }
        public InputReader(int i) {
            try {
                br  = new BufferedReader(
                        new InputStreamReader(new FileInputStream(file)));
            } catch (FileNotFoundException e1) {
                System.out.println("File is not find");
            }
            st = null;
        }
        public String next(){
            while (st==null || !st.hasMoreTokens()){
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public String nextLine(){
            try {
                st1 = new String(br.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return st1;
        }
        public int nextInt()  {return Integer.parseInt(next());}
        public long nextLong(){
            return Long.parseLong(next());
        }
        public Double nextDouble(){
            return Double.parseDouble(next());
        }
        public Byte nextByte() {
            return Byte.parseByte(next());
        }
        private int idx;
        public Character nextChar() {
            if(st1==null) {
                st1 = next();
                idx = 0;
            }
            if(idx!=(st1.length())-1){
                return st1.charAt(idx++);
            }else{
                char  c= st1.charAt(idx);
                st1 = null;
                return c;
            }
        }
        public void newFile() {
            try {
                FileWriter write = new FileWriter(file);
                write.write("something for cheaking");
                write.close();

            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        public void writeFile1(){
            try{
                FileWriter write = new FileWriter(file);
                write.append("100000"+" ");
                for(int i=0; i<100000; i++){
                    write.append(new Integer((int)(Math.random()*5000)).toString()+" ");
                }
                write.close();

            }catch(IOException e){
                e.printStackTrace();
            }
        }
    }
}