class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: F = None
        self.t: G = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.v: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.v: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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