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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.s: A = None
        self.x: 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.o: B = None
        self.t: G = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.s: A = None
        self.x: 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.o: B = None
        self.t: G = None
        self.u: F = None
        self.txt = txt

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

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