class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.x: G = None
        self.q: F = None
        self.z: C = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.q: D = None
        self.x: F = None
        self.v: E = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.x: G = None
        self.q: F = None
        self.z: C = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.q: D = None
        self.x: F = None
        self.v: E = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

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

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

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