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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.r: H = None
        self.s: H = None
        self.u: B = None
        self.y: G = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.txt = txt

h = A("h")
i = B("i")
k = C("k")
l = D("l")
g = E("g")
f = F("f")
e = G("e")
b = H("b")
n = H("n")
d = H("d")

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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.r: H = None
        self.s: H = None
        self.u: B = None
        self.y: G = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.txt = txt

h = A("h")
i = B("i")
k = C("k")
l = D("l")
g = E("g")
f = F("f")
e = G("e")
b = H("b")
n = H("n")
d = H("d")

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