class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: F = None
        self.w: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: E = None
        self.v: F = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: G = None
        self.r: D = None
        self.w: F = None
        self.v: D = None
        self.p: F = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.z: C = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: F = None
        self.w: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: E = None
        self.v: F = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: G = None
        self.r: D = None
        self.w: F = None
        self.v: D = None
        self.p: F = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.z: C = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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