class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: D = None
        self.p: D = None
        self.t: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: F = None
        self.r: F = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: A = None
        self.v: A = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: G = None
        self.z: I = None
        self.v: I = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: A = None
        self.s: B = None
        self.r: E = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

h = A("h")
l = B("l")
m = C("m")
d = D("d")
a = E("a")
n = F("n")
f = G("f")
e = H("e")
g = I("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: F = None
        self.r: F = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: A = None
        self.v: A = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: G = None
        self.z: I = None
        self.v: I = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: A = None
        self.s: B = None
        self.r: E = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

h = A("h")
l = B("l")
m = C("m")
d = D("d")
a = E("a")
n = F("n")
f = G("f")
e = H("e")
g = I("g")

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