Problem: Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Petya got an array consisting of n numbers, it is the gift for his birthday. Now he wants to sort it in the non-decreasing order. However, a usual sorting is boring to perform, that's why Petya invented the following limitation: one can swap any two numbers but only if at least one of them is lucky. Your task is to sort the array according to the specified limitation. Find any possible sequence of the swaps (the number of operations in the sequence should not exceed 2n).

Input

The first line contains an integer n (1 ≤ n ≤ 105) — the number of elements in the array. The second line contains n positive integers, not exceeding 109 — the array that needs to be sorted in the non-decreasing order.

Output

On the first line print number k (0 ≤ k ≤ 2n) — the number of the swaps in the sorting. On the following k lines print one pair of distinct numbers (a pair per line) — the indexes of elements to swap. The numbers in the array are numbered starting from 1. If it is impossible to sort the given sequence, print the single number -1.

If there are several solutions, output any. Note that you don't have to minimize k. Any sorting with no more than 2n swaps is accepted.

Examples

Input

2
4 7


Output

0


Input

3
4 2 1


Output

1
1 3


Input

7
77 66 55 44 33 22 11


Output

7
1 7
7 2
2 6
6 7
3 4
5 3
4 5

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.*;

public class D implements Runnable {
	static List<Integer> allLucky = new ArrayList<Integer>();
	static {
		allLucky.add(4);
		allLucky.add(7);
		for (int i = 0; i < allLucky.size(); i++) {
			int j = allLucky.get(i);
			{
				long e = j * 10L + 4;
				if (e < Integer.MAX_VALUE) {
					allLucky.add((int) e);
				}
			}

			{
				long e = j * 10L + 7;
				if (e < Integer.MAX_VALUE) {
					allLucky.add((int) e);
				}
			}
		}
	}

	static Set<Integer> luckies = new HashSet<Integer>();

	static {
		for (int i : allLucky) {
			luckies.add(i);
		}
	}

	static class Element implements Comparable<Element> {
		int x;
		int n;

		@Override
		public String toString() {
			return "Element [x=" + x + ", n=" + n + "]";
		}

		public Element(int x, int n) {
			super();
			this.x = x;
			this.n = n;
		}

		@Override
		public int compareTo(Element o) {
			return x - o.x;
		}

	}

	static class Answer {
		int a;
		int b;

		public Answer(int a, int b) {
			super();
			this.a = a;
			this.b = b;
		}

	}

	static List<Answer> solve(int[] numbers) {
		int n = numbers.length;
		Element[] a = new Element[n];
		for (int i = 0; i < n; i++) {
			a[i] = new Element(numbers[i], i);
		}
		int id = -1;
		for (int i = 0; i < n; i++) {
			if (luckies.contains(a[i].x)) {
				id = i;
				break;
			}
		}
		Element[] b = a.clone();
		Arrays.sort(b);
		if (Arrays.equals(a, b)) {
			return new ArrayList<Answer>();
		}
		if (id == -1) {
			return null;
		}
		boolean[] did = new boolean[n];
		for (int i = 0; i < n; i++) {
			if (a[i] == b[i]) {
				did[i] = true;
			}
		}
		List<Answer> ans = new ArrayList<Answer>();
		int cur = 0;
		while (cur < n) {
			while (b[id] != a[id]) {
				int newId = b[id].n;
				swap(id, b[id].n, ans, a);
				did[id] = true;
				id = newId;
			}
			while (cur < n && did[cur] || cur == id) {
				cur++;
			}
			if (cur < n) {
				int newId = cur;
				swap(cur, id, ans, a);
				id = newId;
			}
		}
		// for (int i = 1; i < n; i++) {
		// if (a[i].x < a[i - 1].x) {
		// throw new AssertionError();
		// }
		// }
		// if (ans.size() > 2 * n) {
		// throw new AssertionError();
		// }
		return ans;
	}

	void solve() {
		int n = nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		List<Answer> ans = solve(a);
		if (ans == null) {
			out.println(-1);
			return;
		}
		out.println(ans.size());
		for (Answer e : ans) {
			out.println((1 + e.a) + " " + (1 + e.b));
		}
	}

	static Random rand = new Random();

	static void test() {
		int q = 0;
		while (true) {
			if (++q == 100) {
				System.err.println("Test");
				q = 0;
			}
			int[] a = new int[rand.nextInt(100000) + 1];
			for (int i = 0; i < a.length; i++) {
				a[i] = rand.nextInt(100);
			}
			int e = rand.nextInt(5) + 1;
			for (int i = 0; i < e; i++) {
				a[rand.nextInt(a.length)] = allLucky.get(rand.nextInt(allLucky
						.size()));
			}
			solve(a);
		}
	}

	static void swap(int x, int y, List<Answer> ans, Element[] a) {
		{
			int t = a[x].n;
			a[x].n = a[y].n;
			a[y].n = t;
		}
		{
			Element t = a[x];
			a[x] = a[y];
			a[y] = t;
		}
		ans.add(new Answer(x, y));
	}

	FastScanner sc;
	PrintWriter out;

	public void run() {
		Locale.setDefault(Locale.US);
		try {
			sc = new FastScanner(System.in);
			out = new PrintWriter(System.out);
			solve();
			sc.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	int nextInt() {
		return sc.nextInt();
	}

	String nextToken() {
		return sc.nextToken();
	}

	long nextLong() {
		return sc.nextLong();
	}

	double nextDouble() {
		return sc.nextDouble();
	}

	BigInteger nextBigInteger() {
		return sc.nextBigInteger();
	}

	class FastScanner extends BufferedReader {
		StringTokenizer st;
		boolean eof;
		String buf;
		String curLine;
		boolean createST;

		public FastScanner(String fileName) throws FileNotFoundException {
			this(fileName, true);
		}

		public FastScanner(String fileName, boolean createST)
				throws FileNotFoundException {
			super(new FileReader(fileName));
			this.createST = createST;
			nextToken();
		}

		public FastScanner(InputStream stream) {
			this(stream, true);
		}

		public FastScanner(InputStream stream, boolean createST) {
			super(new InputStreamReader(stream));
			this.createST = createST;
			nextToken();
		}

		String nextLine() {
			String ret = curLine;
			if (createST) {
				st = null;
			}
			nextToken();
			return ret;
		}

		String nextToken() {
			if (!createST) {
				try {
					curLine = readLine();
				} catch (Exception e) {
					eof = true;
				}
				return null;
			}
			while (st == null || !st.hasMoreTokens()) {
				try {
					curLine = readLine();
					st = new StringTokenizer(curLine);
				} catch (Exception e) {
					eof = true;
					break;
				}
			}
			String ret = buf;
			buf = eof ? "-1" : st.nextToken();
			return ret;
		}

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

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

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

		BigInteger nextBigInteger() {
			return new BigInteger(nextToken());
		}

		public void close() {
			try {
				buf = null;
				st = null;
				curLine = null;
				super.close();
			} catch (Exception e) {

			}
		}

		boolean isEOF() {
			return eof;
		}
	}

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