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

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

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

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

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

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

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

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

d = A("d")
l = B("l")
i = C("i")
m = D("m")
a = E("a")
b = F("b")
f = G("f")
k = H("k")
h = G("h")
c = E("c")

d.z = k
d.o = a
l.r = i
i.p = b
i.u = m
i.q = a
m.q = d
a.p = l
b.s = d
b.z = k
b.r = f
f.p = l
f.w = l
f.t = b
k.s = m
k.r = m
k.q = i
k.t = i
k.o = h
k.w = b
k.z = b
k.u = f
h.p = l
h.w = l
h.t = b
c.p = l
assert f.t.z.q.u.q.o.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

d = A("d")
l = B("l")
i = C("i")
m = D("m")
a = E("a")
b = F("b")
f = G("f")
k = H("k")
h = G("h")
c = E("c")

d.z = k
d.o = a
l.r = i
i.p = b
i.u = m
i.q = a
m.q = d
a.p = l
b.s = d
b.z = k
b.r = f
f.p = l
f.w = l
f.t = b
k.s = m
k.r = m
k.q = i
k.t = i
k.o = h
k.w = b
k.z = b
k.u = f
h.p = l
h.w = l
h.t = b
c.p = l
assert f.t.z.q.u.q.o.p.r.txt == "i"