/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Map<String, Map<String, Integer>> before = new HashMap<>();
        Map<String, Integer> map11 = new HashMap<>();
        map11.put("foo", 1);
        before.put("foo", map11);
        Map<String, Integer> map12 = new HashMap<>();
        map12.put("bar", 2);
        before.put("bar", map12);
        Map<Integer, Map<String, Integer>> after = new HashMap<>();

        System.out.println(before);

        AtomicInteger a = new AtomicInteger(0);
        before.forEach((key, value) -> after.put(a.getAndIncrement(), value));

        System.out.println(after);
	}
}