Nanosecond electric explosion of a tungsten wire in different media