class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: C = None
        self.s: G = None
        self.z: C = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: B = None
        self.txt = txt

i = A("i")
g = B("g")
a = C("a")
d = D("d")
k = E("k")
l = F("l")
c = G("c")

i.u = l
i.q = a
i.z = a
i.s = c
i.w = d
i.y = k
g.y = d
g.u = d
a.w = d
d.v = l
d.o = i
k.q = g
l.p = g
l.z = k
c.t = i
c.x = g
assert a.w.v.p.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: C = None
        self.s: G = None
        self.z: C = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: B = None
        self.txt = txt

i = A("i")
g = B("g")
a = C("a")
d = D("d")
k = E("k")
l = F("l")
c = G("c")

i.u = l
i.q = a
i.z = a
i.s = c
i.w = d
i.y = k
g.y = d
g.u = d
a.w = d
d.v = l
d.o = i
k.q = g
l.p = g
l.z = k
c.t = i
c.x = g
assert a.w.v.p.y.v.txt == "l"