class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.r: C = None
        self.p: H = None
        self.w: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.o: G = None
        self.p: D = None
        self.x: G = None
        self.z: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.o: G = None
        self.p: D = None
        self.x: G = None
        self.z: B = None
        self.q: B = None
        self.txt = txt

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

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