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

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: E = None
        self.v: G = None
        self.s: C = None
        self.p: D = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: G = None
        self.y: E = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

h = A("h")
e = B("e")
l = C("l")
m = D("m")
d = E("d")
n = F("n")
a = G("a")
g = D("g")
f = B("f")

h.w = m
h.o = l
h.q = g
e.s = a
e.x = h
e.z = l
l.s = n
l.z = n
l.u = f
l.r = f
l.w = e
l.v = d
l.x = h
m.z = g
m.p = g
m.t = d
m.q = d
m.v = a
m.s = l
d.z = f
d.y = n
n.s = e
n.v = a
n.y = d
n.x = l
n.t = h
a.t = l
a.o = l
a.s = h
a.r = h
a.w = d
a.p = m
a.z = f
g.z = m
g.p = m
g.t = d
g.q = d
g.v = a
g.s = l
f.s = a
f.x = h
f.z = l
assert n.v.w.z.x.q.v.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: E = None
        self.v: G = None
        self.s: C = None
        self.p: D = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: G = None
        self.y: E = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

h = A("h")
e = B("e")
l = C("l")
m = D("m")
d = E("d")
n = F("n")
a = G("a")
g = D("g")
f = B("f")

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