Can you make this MUCH faster? The output is correct nut the code is to slow, dont add comments in code
using System;
using System.Buffers;
using System.Runtime.CompilerServices;

public class TranslatorsDinner
{
    public static void Main()
    {
        Span<int> input = stackalloc int[2];
        ParseInts(Console.ReadLine(), input);
        int N = input[0], M = input[1];

        if ((M & 1) != 0)
        {
            Console.WriteLine("impossible");
            return;
        }

        Span<int> translators = stackalloc int[M * 2];
        Span<int> adjacencyList = stackalloc int[M * M];
        Span<int> adjacencyCounts = stackalloc int[M];

        for (int i = 0; i < M; i++)
        {
            ParseInts(Console.ReadLine(), translators.Slice(i * 2, 2));
        }

        for (int i = 0; i < M; i++)
        {
            int lang1A = translators[i * 2], lang2A = translators[i * 2 + 1];
            for (int j = i + 1; j < M; j++)
            {
                int lang1B = translators[j * 2], lang2B = translators[j * 2 + 1];
                if (lang1A == lang1B || lang1A == lang2B || lang2A == lang1B || lang2A == lang2B)
                {
                    adjacencyList[i * M + adjacencyCounts[i]++] = j;
                    adjacencyList[j * M + adjacencyCounts[j]++] = i;
                }
            }
        }

        Span<bool> matched = stackalloc bool[M];
        Span<int> pairs = stackalloc int[M];
        int pairCount = 0;

        if (!MatchTranslators(0, matched, pairs, ref pairCount, adjacencyList, adjacencyCounts, M))
        {
            Console.WriteLine("impossible");
            return;
        }

        for (int i = 0; i < pairCount; i++)
        {
            Console.WriteLine($"{pairs[i * 2]} {pairs[i * 2 + 1]}");
        }
    }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    private static bool MatchTranslators(int current, Span<bool> matched, Span<int> pairs, ref int pairCount, Span<int> adjacencyList, Span<int> adjacencyCounts, int M)
    {
        while (current < M && matched[current])
        {
            current++;
        }

        if (current >= M)
        {
            return pairCount == M / 2;
        }

        matched[current] = true;
        int start = current * M;
        for (int i = 0; i < adjacencyCounts[current]; i++)
        {
            int next = adjacencyList[start + i];
            if (!matched[next])
            {
                matched[next] = true;
                pairs[pairCount * 2] = current;
                pairs[pairCount * 2 + 1] = next;
                pairCount++;

                if (MatchTranslators(current + 1, matched, pairs, ref pairCount, adjacencyList, adjacencyCounts, M))
                {
                    return true;
                }

                pairCount--;
                matched[next] = false;
            }
        }
        matched[current] = false;

        return false;
    }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    private static void ParseInts(string s, Span<int> result)
    {
        int index = 0, num = 0, resultIndex = 0;
        while (index < s.Length)
        {
            char c = s[index++];
            if (c >= '0' && c <= '9')
            {
                num = num * 10 + (c - '0');
            }
            else if (num > 0)
            {
                result[resultIndex++] = num;
                num = 0;
            }
        }
        if (num > 0)
        {
            result[resultIndex] = num;
        }
    }
}