Write q files