Mongolian PM resigns after months of upheaval