In this situation in which Person (X) was approached by Person (Y) with a project idea, which is to be published as a research paper.
Person (X) has written the entire code, collected the dataset, ran all tests and prepared the outputs for the project. The time taken for this was around 2 months (approx.)
Person (Y) prepared the manuscript for the paper (only text) where as the algorithmic details, flow charts, outputs were provided by Person (X).
In the first draft of the paper, Person (Y) gives himself first authorship on his own. The point to be noted here is Person (X) is not backed by any academic gains in form of LOR from the academic guide of Person (Y), Person (X) contributed as an independent contributor to the paper. Now, Person (Y) claims he'll consult about this with his academic guide, who's the third author of this paper.
My question here is:
Who has more contribution in this paper (which is basically a practical/project paper) the one who has written the code (X) or the one who wrote the manuscript (Y)?
How to raise this dispute if it is not resolved with mutual discussion?