This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public…