How to compare the positions of two or more instantiated gameobjects (clones) with different tags?

I tried the following function. But, its not working.

void GameLogic()
{
GameObject one = GameObject.FindGameObjectWithTag(“One”);
GameObject two = GameObject.FindGameObjectWithTag(“Two”);

    if (one.transform.position.x == two.transform.position.x)
    {
        Debug.Log("inline");
    }  
}

Here, gameobjects are clones of the original.

create tags “one”,“two”
set the tags dynamically using script when instantiating.
use your function top find them.