Masha really loves algebra. On the last lesson, her strict teacher Dvastan gave she new exercise.

You are given geometric progression b defined by two integers b1 and q. Remind that a geometric progression is a sequence of integers b1, b2, b3, ..., where for each i > 1 the respective term satisfies the condition bi = bi - 1·q, where q is called the common ratio of the progression. Progressions in Uzhlyandia are unusual: both b1 and q can equal 0. Also, Dvastan gave Masha m "bad" integers a1, a2, ..., am, and an integer l.

Masha writes all progression terms one by one onto the board (including repetitive) while condition |bi| ≤ l is satisfied (|x| means absolute value of x). There is an exception: if a term equals one of the "bad" integers, Masha skips it (doesn't write onto the board) and moves forward to the next term.

But the lesson is going to end soon, so Masha has to calculate how many integers will be written on the board. In order not to get into depression, Masha asked you for help: help her calculate how many numbers she will write, or print "inf" in case she needs to write infinitely many integers.

Input

The first line of input contains four integers b1, q, l, m (-109 ≤ b1, q ≤ 109, 1 ≤ l ≤ 109, 1 ≤ m ≤ 105) — the initial term and the common ratio of progression, absolute value of maximal number that can be written on the board and the number of "bad" integers, respectively.

The second line contains m distinct integers a1, a2, ..., am (-109 ≤ ai ≤ 109) — numbers that will never be written on the board.

Output

Print the only integer, meaning the number of progression terms that will be written on the board if it is finite, or "inf" (without quotes) otherwise.

Examples

Input

3 2 30 4
6 14 25 48


Output

3

Input

123 1 2143435 4
123 11 -5453 141245


Output

0

Input

123 1 2143435 4
54343 -13 6 124


Output

inf

Note

In the first sample case, Masha will write integers 3, 12, 24. Progression term 6 will be skipped because it is a "bad" integer. Terms bigger than 24 won't be written because they exceed l by absolute value.

In the second case, Masha won't write any number because all terms are equal 123 and this is a "bad" integer.

In the third case, Masha will write infinitely integers 123. 
import java.util.*;
import java.io.*;
import java.math.*;
public class Fuck{
	static long MOD=(long)Math.pow(10,9)+7;
	static final int lint=Integer.MAX_VALUE;
	static final double ldouble=Double.MAX_VALUE;
	public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try{
                    solve();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
	}
    static InputReader in;
    static PrintWriter w;
    static void solve(){
        in = new InputReader(System.in);
        w = new PrintWriter(System.out);
        long b1=in.nextLong();
        long q=in.nextLong();
        long l=in.nextLong();
        long m=in.nextLong();
        HashSet<Long> hs=new HashSet<Long>();
        for(int i=0;i<m;i++){
        	hs.add(in.nextLong());
        }
        if(Math.abs(b1)>l){
        	w.println("0");
        }
        else if(b1==0L){
        	if(hs.contains(b1)){
        		w.println("0");
        	}else{
        		w.println("inf");
        	}
        }
        else if(q==0L){
        	if(!hs.contains(b1)&&hs.contains(0L)){
        		if(Math.abs(b1)<=l){
        			w.println("1");
        		}else{
        			w.println("0");
        		}
        	}
        	else if(!hs.contains(0L)){
        		if(Math.abs(b1)<=l)
        		w.println("inf");
        		else{
        			w.println("0");
        		}
        	}
        	else{
        		w.println("0");
        	}
        }
        else if(q==-1L){
        	if(!hs.contains(b1)||!hs.contains(-b1)){
        		if(b1<=l)
        			w.println("inf");
        		else{
        			w.println("0");
        		}
        	}
        	else{
        		w.println("0");
        	}
        }
        else if(q==1L){
        	if(Math.abs(b1)<=l&&!hs.contains(b1)){
        		w.println("inf");
        	}
        	else{
        		w.println("0");
        	}
        }else{
        	long count=0;
        	while(true){
        		if(Math.abs(b1)>l){
        			break;
        		}
        		if(Math.abs(b1)<=l&&!hs.contains(b1)){
        			count++;
        		}
        		b1=b1*q;
        	}
        	w.println(count);
        }
        w.close();
    }
    
//  //if  str2 (pattern) is subsequence of str1 (Text) or not
//	static boolean function(String str1,String str2){
//	     str2 = str2.replace("", ".*");  //returns .*a.*n.*n.*a.
//	     return (str1.matches(str2));  // returns true
//	}
    static double convert(double a){
    	return Math.round(a * 100.0) / 100.0;
    }
    static boolean flag=false;
    static HashSet<Integer> ans;
    static int Arr[];
    static long size[];
  //modified initialize function:
    static void initialize(int N){
    	Arr=new int[N];
    	size=new long[N];
        for(int i = 0;i<N;i++){
        	Arr[ i ] = i ;
        	size[ i ] = 1;
        }
    }
    static boolean find(int A,int B){
        if( root(A)==root(B) )       //if A and B have same root,means they are connected.
        return true;
        else
        return false;
    }
 // modified root function.
    static void weighted_union(int A,int B,int n){
        int root_A = root(A);
        int root_B = root(B);
        if(size[root_A] < size[root_B ]){
        	Arr[ root_A ] = Arr[root_B];
        	size[root_B] += size[root_A];
        }
        else{
        	Arr[ root_B ] = Arr[root_A];
        	size[root_A] += size[root_B];
        }
    }
    static int root (int i){
        while(Arr[ i ] != i){
            Arr[ i ] = Arr[ Arr[ i ] ] ; 
            i = Arr[ i ]; 
        }
        return i;
    }
    
//	static long gcd(long a,long b){
//		if(a==0){
//			return b;
//		}
//		return gcd(b%a,a);
//	}
//	static boolean isPrime[];
////	 //for marking all prime numbers greater than 1 and less than equal to N
//	static void sieve(int N) {
//      isPrime=new boolean[N+1];
//      isPrime[0] = true;
//      isPrime[1] = true;
//      for(int i = 2; i * i <= N; ++i) {
//           if(isPrime[i] == false) {//Mark all the multiples of i as composite numbers
//               for(int j = i * i; j <= N ;j += i)
//                   isPrime[j] = true;
//          }
//      }
//	}
//	static boolean isPrime(long n) {
//		if(n < 2L) return false;
//		if(n == 2L || n == 3L) return true;
//		if(n%2L == 0 || n%3L == 0) return false;	
//		long sqrtN = (long)Math.sqrt(n)+1L;
//		for(long i = 6L; i <= sqrtN; i += 6L) {
//			if(n%(i-1) == 0 || n%(i+1) == 0) return false;
//		}
//		return true;
//	}
//	static HashMap<Integer,Integer> level;;
//	static HashMap<Integer,Integer> parent;
	static int maxlevel=0;
	static ArrayList<Integer> adj[]; //Adjacency Lists
    static int V;   // No. of vertices
    // Constructor
    static void Graph(int v){
        V = v;
        adj = new ArrayList[v];
        for (int i=0; i<v; ++i){
        	adj[i] = new ArrayList();
        }
    }
    // Function to add an edge into the graph
    static void addEdge(int v,int w){
		adj[v].add(w);
//		adj[w].add(v);
    }
    static void bfs(int s,int n){
    	boolean visited[]=new boolean[n];
    	LinkedList<Integer> queue=new LinkedList<Integer>();
    	queue.add(s);
    	visited[s]=true;
    	ans.add(s);
    	while(!queue.isEmpty()){
    		int num=queue.pop();
//    		System.out.println(ans.toString());
    		if(flag){
    			break;
    		}
    		for(int i=0;i<adj[num].size();i++){
    			if(!visited[adj[num].get(i)]){
    				visited[adj[num].get(i)]=true;
    				queue.add(adj[num].get(i));
    				ans.add(adj[num].get(i));
    				if(ans.size()==n){
    					flag=true;
    					break;
    				}
    			}
    		}
    	}
    }
//	static boolean T[][][];
//	static void subsetSum(int input[], int total, int count) {
//        T = new boolean[input.length + 1][total + 1][count+1];
//        for (int i = 0; i <= input.length; i++) {
//        	T[i][0][0] = true;
//        	for(int j = 1; j<=count; j++){
//        		T[i][0][j] = false;
//        	}
//        }
//        int sum[]=new int[input.length+1];
//        for(int i=1;i<=input.length;i++){
//            sum[i]=sum[i-1]+input[i-1];
//        }
//        for (int i = 1; i <= input.length; i++) {
//            for (int j = 1; j <= (int)Math.min(total,sum[i]); j++) {
//            	for (int k = 1; k <= (int)Math.min(i,count); k++){
//            		 if (j >= input[i - 1]) {//Exclude and Include
//                         T[i][j][k] = T[i - 1][j][k] || T[i - 1][j - input[i - 1]][k-1];
//                     } else {
//                         T[i][j][k] = T[i-1][j][k];
//                     }
//            	}
//            }
//        }
//    }
//	static <K,V extends Comparable<? super V>>
//	SortedSet<Map.Entry<K,V>> entriesSortedByValues(Map<K,V> map) {
//	    SortedSet<Map.Entry<K,V>> sortedEntries = new TreeSet<Map.Entry<K,V>>(
//	        new Comparator<Map.Entry<K,V>>() {
//	            @Override public int compare(Map.Entry<K,V> e1, Map.Entry<K,V> e2) {
//	                int res = e2.getValue().compareTo(e1.getValue());
//	                return res != 0 ? res : 1;
//	            }
//	        }
//	    );
//	    sortedEntries.addAll(map.entrySet());
//	    return sortedEntries;
//	}
	
 
	 
	//minimum prime factor of all the numbers less than n
    static int minPrime[];
	static void minimumPrime(int n){
		minPrime=new int[n+1];
		minPrime[1]=1;
        for (int i = 2; i * i <= n; ++i) {
            if (minPrime[i] == 0) {         //If i is prime
                for (int j = i * i; j <= n; j += i) {
                    if (minPrime[j] == 0) {
                        minPrime[j] = i;
                    }
                }
            }
        }
        for (int i = 2; i <= n; ++i) {
            if (minPrime[i] == 0) {
                minPrime[i] = i;
            }
        }
	}
	static long power(long base, long exponent, long modulus){
	    long result = 1;
	    while (exponent > 0) {
	        if (exponent % 2 == 1)
	            result = (result * base) % modulus;
	        exponent = exponent >> 1;
	        base = (base * base) % modulus;
	    }
	    return result;
	}
	static long modInverse(long A, long M)
	{
		long x=extendedEuclid(A,M)[0];
		return (x%M+M)%M;    //x may be negative
	}
	static long[] extendedEuclid(long A, long B) {
		if(B == 0) {
			long d = A;
			long x = 1;
			long y = 0;
			return new long[]{x,y,d};
		}
		else {
			long arr[]=extendedEuclid(B, A%B);
			long temp = arr[0];
			arr[0] = arr[1];
			arr[1] = temp - (A/B)*arr[1];
			return arr;
		}
	}
 
	static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, numChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        
        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }
 
        public String nextLine() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }
 
        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }
 
        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
	}
} 
class NodeS{
	char x;
	char y;
	public void setx(char x){
		this.x=x;
	}
	public void sety(char y){
		this.y=y;
	}
	public char getx(){
		return x;
	}
	public char gety(){
		return y;
	}
}