1. 

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 10474 - Where is the Marble?
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1415
*
* @author Evgeni Pavlidis
* @version 1.0, 06/02/2010
*
* Method : Ad hoc - Sorting
* Status : Accepted
* Runtime: 2.688
*/

import java.io.*;
import java.util.*;

class Main {

public static void main(String...args)
{
Scanner sc = new Scanner(System.in);

int n, q, caseNumber = 1;
Map<Integer, Integer> map = new HashMap<Integer, Integer>();

while(true)
{
map.clear();

n = sc.nextInt();
q = sc.nextInt();
if(n == 0 && q == 0)
break;

int[] a = new int[n];

for(int i = 0; i < n; i++)
a[i] = sc.nextInt();

Arrays.sort(a);

int j = -1;
for(int i = 0; i < n; i++)
if(a[i] != j)
{
map.put(a[i], i+1);
j = a[i];
}

System.out.println("CASE# " + caseNumber++ + ":");

for(int i = 0; i < q; i++)
{
int query = sc.nextInt();
if(map.containsKey(query))
System.out.println(query + " found at " + map.get(query));
else
System.out.println(query + " not found");
}
}
}
}