class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: F = None
        self.p: A = None
        self.z: G = None
        self.q: A = None
        self.y: A = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.y: G = None
        self.p: H = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.u: G = None
        self.o: E = None
        self.t: E = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: B = None
        self.q: C = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.y: G = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: E = None
        self.u: C = None
        self.r: F = None
        self.y: D = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.x: G = None
        self.o: B = None
        self.s: B = None
        self.txt = txt

g = A("g")
i = B("i")
f = C("f")
n = D("n")
j = E("j")
h = F("h")
e = G("e")
a = H("a")

g.w = e
g.p = a
i.r = g
i.p = g
i.q = g
i.y = g
i.o = h
i.z = e
i.t = e
f.x = j
f.o = n
f.y = e
f.p = a
f.t = g
n.x = i
n.q = i
n.r = e
n.u = e
n.o = j
n.t = j
n.p = f
j.r = f
j.q = f
j.y = i
j.t = g
h.z = i
h.s = i
h.y = e
h.v = n
e.s = i
e.w = j
e.v = j
e.u = f
e.x = f
e.r = h
e.y = n
a.r = f
a.q = f
a.x = e
a.o = i
a.s = i
assert n.q.o.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: F = None
        self.p: A = None
        self.z: G = None
        self.q: A = None
        self.y: A = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.y: G = None
        self.p: H = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.u: G = None
        self.o: E = None
        self.t: E = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: B = None
        self.q: C = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.y: G = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: E = None
        self.u: C = None
        self.r: F = None
        self.y: D = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.x: G = None
        self.o: B = None
        self.s: B = None
        self.txt = txt

g = A("g")
i = B("i")
f = C("f")
n = D("n")
j = E("j")
h = F("h")
e = G("e")
a = H("a")

g.w = e
g.p = a
i.r = g
i.p = g
i.q = g
i.y = g
i.o = h
i.z = e
i.t = e
f.x = j
f.o = n
f.y = e
f.p = a
f.t = g
n.x = i
n.q = i
n.r = e
n.u = e
n.o = j
n.t = j
n.p = f
j.r = f
j.q = f
j.y = i
j.t = g
h.z = i
h.s = i
h.y = e
h.v = n
e.s = i
e.w = j
e.v = j
e.u = f
e.x = f
e.r = h
e.y = n
a.r = f
a.q = f
a.x = e
a.o = i
a.s = i
assert n.q.o.y.s.y.txt == "g"