class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: B = None
        self.p: B = None
        self.q: H = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.p: F = None
        self.y: B = None
        self.w: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: G = None
        self.r: G = None
        self.s: G = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.r: A = None
        self.p: G = None
        self.u: G = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.w: F = None
        self.r: C = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.p: F = None
        self.y: B = None
        self.w: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: G = None
        self.r: G = None
        self.s: G = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.r: A = None
        self.p: G = None
        self.u: G = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.w: F = None
        self.r: C = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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