public int stupid(Map<Integer, Integer> map) {
		int[] cards = new int[map.size()];
		for(Map.Entry<Integer, Integer> entry : map.entrySet()) {
			cards[entry.getValue()] = entry.getKey();
		}
		
//		print(cards);
		int count = 1;
		
		while(true) {
			boolean found = true;
			for(int i = 0; i < cards.length; i++) {
				if(cards[i] != i) {
					found = false;
					break;
				}
			}
			if(found) {
				return count;
			}
			
			int[] newCards = new int[cards.length];
			for(Map.Entry<Integer, Integer> entry : map.entrySet()) {
				newCards[entry.getValue()] = cards[entry.getKey()];
			}
			cards = newCards;
			count++;
		}
	}