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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: F = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.t: A = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.o: G = None
        self.r: D = None
        self.w: A = None
        self.txt = txt

e = A("e")
n = B("n")
i = C("i")
a = D("a")
j = E("j")
d = F("d")
b = G("b")
g = G("g")

e.z = n
e.x = j
n.s = g
i.z = g
i.q = d
a.z = n
a.w = i
a.s = g
j.w = b
j.p = d
j.r = a
d.w = a
d.s = i
d.t = e
d.z = n
d.o = j
b.y = g
b.o = g
b.x = e
b.w = e
b.r = a
g.y = b
g.o = b
g.x = e
g.w = e
g.r = a
assert g.y.x.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: F = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.t: A = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.o: G = None
        self.r: D = None
        self.w: A = None
        self.txt = txt

e = A("e")
n = B("n")
i = C("i")
a = D("a")
j = E("j")
d = F("d")
b = G("b")
g = G("g")

e.z = n
e.x = j
n.s = g
i.z = g
i.q = d
a.z = n
a.w = i
a.s = g
j.w = b
j.p = d
j.r = a
d.w = a
d.s = i
d.t = e
d.z = n
d.o = j
b.y = g
b.o = g
b.x = e
b.w = e
b.r = a
g.y = b
g.o = b
g.x = e
g.w = e
g.r = a
assert g.y.x.z.s.txt == "g"