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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: A = None
        self.p: E = None
        self.txt = txt

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

i.z = d
i.v = k
i.q = h
e.r = h
b.u = i
b.x = g
d.z = h
k.r = a
k.y = d
a.u = d
h.u = a
h.w = i
l.t = i
l.r = i
l.p = k
g.u = i
g.x = b
m.t = i
m.r = i
m.p = k
assert i.v.r.u.z.u.u.z.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: E = None
        self.q: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: A = None
        self.p: E = None
        self.txt = txt

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

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