import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;
import static java.lang.Integer.*;
import static java.lang.Double.*;
import java.lang.Math.*;

public class Main {

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	public void run() throws Exception {
		FastIO file = new FastIO();
		int n = file.nextInt();
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) v[i] = file.nextInt();
		for (int i = 0; i < n; i++) c[i] = file.nextInt();
		int ans = Integer.MIN_VALUE;
		for (int i = 0; i <= 1 << n; i++) {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		}
		System.out.println(ans);
	}

	public static class FastIO {
		BufferedReader br;
		StringTokenizer st;

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	public static long pow(long n, long p, long mod) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	}

	public static long pow(long n, long p) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	}

	public static long gcd(long x, long y) {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	}

	public static boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.text.*; text.* java import java.math.*; math.* java import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Double.*; import static java.lang.Double.*; import static java.lang.Double.*; import java.lang.Math.*; Math.* java.lang public class Main {

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	public void run() throws Exception {
		FastIO file = new FastIO();
		int n = file.nextInt();
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) v[i] = file.nextInt();
		for (int i = 0; i < n; i++) c[i] = file.nextInt();
		int ans = Integer.MIN_VALUE;
		for (int i = 0; i <= 1 << n; i++) {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		}
		System.out.println(ans);
	}

	public static class FastIO {
		BufferedReader br;
		StringTokenizer st;

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	public static long pow(long n, long p, long mod) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	}

	public static long pow(long n, long p) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	}

	public static long gcd(long x, long y) {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	}

	public static boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}
} Main public static void main(String[] args) throws Exception {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public void run() throws Exception {
		FastIO file = new FastIO();
		int n = file.nextInt();
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) v[i] = file.nextInt();
		for (int i = 0; i < n; i++) c[i] = file.nextInt();
		int ans = Integer.MIN_VALUE;
		for (int i = 0; i <= 1 << n; i++) {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		}
		System.out.println(ans);
	} run {
		FastIO file = new FastIO();
		int n = file.nextInt();
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) v[i] = file.nextInt();
		for (int i = 0; i < n; i++) c[i] = file.nextInt();
		int ans = Integer.MIN_VALUE;
		for (int i = 0; i <= 1 << n; i++) {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		}
		System.out.println(ans);
	} FastIO file = new FastIO(); file new FastIO() int n = file.nextInt(); n file.nextInt() file.nextInt file int[] v = new int[n]; v new int[n] n int[] c = new int[n]; c new int[n] n for (int i = 0; i < n; i++) v[i] = file.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i v[i] = file.nextInt(); v[i] = file.nextInt() v[i] v i file.nextInt() file.nextInt file for (int i = 0; i < n; i++) c[i] = file.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i c[i] = file.nextInt(); c[i] = file.nextInt() c[i] c i file.nextInt() file.nextInt file int ans = Integer.MIN_VALUE; ans Integer.MIN_VALUE Integer Integer.MIN_VALUE for (int i = 0; i <= 1 << n; i++) {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		} int i = 0; int i = 0; i 0 i <= 1 << n i 1 << n 1 n i++ i++ i {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		} {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		} int a = 0 a 0 b = 0; b 0 for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			} {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			} if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				} (i & (1 << j)) > 0 (i & (1 << j)) i (1 << j) 1 j 0 {
					a += v[j];
					b += c[j];
				} a += v[j] a v[j] v j b += c[j] b c[j] c j ans = Math.max(ans, a - b) ans Math.max(ans, a - b) Math.max Math ans a - b a b System.out.println(ans) System.out.println System.out System System.out ans public static long pow(long n, long p, long mod) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	} pow {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	} if (p == 0)
			return 1; p == 0 p 0 return 1; 1 if (p == 1)
			return n % mod; p == 1 p 1 return n % mod; n % mod n mod if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		} p % 2 == 0 p % 2 p 2 0 {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} long temp = pow(n, p / 2, mod); temp pow(n, p / 2, mod) pow n p / 2 p 2 mod return (temp * temp) % mod; (temp * temp) % mod (temp * temp) temp temp mod {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		} long temp = pow(n, p / 2, mod); temp pow(n, p / 2, mod) pow n p / 2 p 2 mod temp = (temp * temp) % mod temp (temp * temp) % mod (temp * temp) temp temp mod return (temp * n) % mod; (temp * n) % mod (temp * n) temp n mod long n n long p p long mod mod public static long pow(long n, long p) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	} pow {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	} if (p == 0)
			return 1; p == 0 p 0 return 1; 1 if (p == 1)
			return n; p == 1 p 1 return n; n if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		} p % 2 == 0 p % 2 p 2 0 {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} long temp = pow(n, p / 2); temp pow(n, p / 2) pow n p / 2 p 2 return (temp * temp); (temp * temp) temp temp {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		} long temp = pow(n, p / 2); temp pow(n, p / 2) pow n p / 2 p 2 temp = (temp * temp) temp (temp * temp) temp temp return (temp * n); (temp * n) temp n long n n long p p public static long gcd(long x, long y) {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	} gcd {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	} if (x == 0)
			return y;
		else
			return gcd(y % x, x); x == 0 x 0 return y; y return gcd(y % x, x); gcd(y % x, x) gcd y % x y x x long x x long y y public static boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	} isPrime {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	} if (n <= 1)
			return false; n <= 1 n 1 return false; false if (n <= 3)
			return true; n <= 3 n 3 return true; true if (n % 2 == 0 || n % 3 == 0)
			return false; n % 2 == 0 || n % 3 == 0 n % 2 == 0 n % 2 n 2 0 n % 3 == 0 n % 3 n 3 0 return false; false for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false; int i = 5; int i = 5; i 5 i * i <= n i * i i i n i = i + 6 i = i + 6 i i + 6 i 6 if (n % i == 0 || n % (i + 2) == 0)
				return false; if (n % i == 0 || n % (i + 2) == 0)
				return false; n % i == 0 || n % (i + 2) == 0 n % i == 0 n % i n i 0 n % (i + 2) == 0 n % (i + 2) n (i + 2) i 2 0 return false; false return true; true int n n public static class FastIO {
		BufferedReader br;
		StringTokenizer st;

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	} FastIO BufferedReader br; br StringTokenizer st; st public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
		} FastIO {
			br = new BufferedReader(new InputStreamReader(System.in));
		} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		} next {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		} while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			} st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			} try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				} IOException e {
					e.printStackTrace();
				} e.printStackTrace() e.printStackTrace e {
					st = new StringTokenizer(br.readLine());
				} st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() {
			return Integer.parseInt(next());
		} nextInt {
			return Integer.parseInt(next());
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() {
			return Double.parseDouble(next());
		} nextDouble {
			return Double.parseDouble(next());
		} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		} nextLine {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		} String str = ""; str "" try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			} IOException e {
				e.printStackTrace();
			} e.printStackTrace() e.printStackTrace e {
				str = br.readLine();
			} str = br.readLine() str br.readLine() br.readLine br return str; str public class Main {

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	public void run() throws Exception {
		FastIO file = new FastIO();
		int n = file.nextInt();
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) v[i] = file.nextInt();
		for (int i = 0; i < n; i++) c[i] = file.nextInt();
		int ans = Integer.MIN_VALUE;
		for (int i = 0; i <= 1 << n; i++) {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		}
		System.out.println(ans);
	}

	public static class FastIO {
		BufferedReader br;
		StringTokenizer st;

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	public static long pow(long n, long p, long mod) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	}

	public static long pow(long n, long p) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	}

	public static long gcd(long x, long y) {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	}

	public static boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	public void run() throws Exception {
		FastIO file = new FastIO();
		int n = file.nextInt();
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) v[i] = file.nextInt();
		for (int i = 0; i < n; i++) c[i] = file.nextInt();
		int ans = Integer.MIN_VALUE;
		for (int i = 0; i <= 1 << n; i++) {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		}
		System.out.println(ans);
	}

	public static class FastIO {
		BufferedReader br;
		StringTokenizer st;

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	public static long pow(long n, long p, long mod) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	}

	public static long pow(long n, long p) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	}

	public static long gcd(long x, long y) {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	}

	public static boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}
} Main
import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;
import static java.lang.Integer.*;
import static java.lang.Double.*;
import java.lang.Math.*;

public class Main {

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	public void run() throws Exception {
		FastIO file = new FastIO();
		int n = file.nextInt();
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) v[i] = file.nextInt();
		for (int i = 0; i < n; i++) c[i] = file.nextInt();
		int ans = Integer.MIN_VALUE;
		for (int i = 0; i <= 1 << n; i++) {
			int a = 0, b = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) {
					a += v[j];
					b += c[j];
				}
			}
			ans = Math.max(ans, a - b);
		}
		System.out.println(ans);
	}

	public static class FastIO {
		BufferedReader br;
		StringTokenizer st;

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	public static long pow(long n, long p, long mod) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	}

	public static long pow(long n, long p) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	}

	public static long gcd(long x, long y) {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	}

	public static boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}
}
