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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.r: H = None
        self.z: H = None
        self.q: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: F = None
        self.t: C = None
        self.x: D = None
        self.z: F = None
        self.txt = txt

i = A("i")
d = B("d")
k = C("k")
n = D("n")
j = E("j")
l = F("l")
g = G("g")
h = H("h")
f = C("f")
m = F("m")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.r: H = None
        self.z: H = None
        self.q: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: F = None
        self.t: C = None
        self.x: D = None
        self.z: F = None
        self.txt = txt

i = A("i")
d = B("d")
k = C("k")
n = D("n")
j = E("j")
l = F("l")
g = G("g")
h = H("h")
f = C("f")
m = F("m")

i.z = n
i.r = h
d.v = m
k.z = h
k.w = h
k.p = j
k.q = j
k.r = n
k.u = l
n.y = l
n.r = j
j.o = d
j.z = i
l.u = j
l.t = m
l.q = m
l.r = h
l.z = h
g.v = j
g.x = f
h.y = j
h.q = m
h.t = k
h.x = n
h.z = l
f.z = h
f.w = h
f.p = j
f.q = j
f.r = n
f.u = l
m.u = j
m.t = l
m.q = l
m.r = h
m.z = h
assert k.u.r.z.t.u.z.z.r.o.txt == "d"