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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: G = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: C = None
        self.r: G = None
        self.u: A = None
        self.s: H = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: F = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: D = None
        self.w: A = None
        self.x: F = None
        self.z: B = None
        self.t: C = None
        self.u: H = None
        self.txt = txt

n = A("n")
a = B("a")
c = C("c")
e = D("e")
h = E("h")
l = F("l")
i = G("i")
b = H("b")
d = I("d")

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: G = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: C = None
        self.r: G = None
        self.u: A = None
        self.s: H = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: F = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: D = None
        self.w: A = None
        self.x: F = None
        self.z: B = None
        self.t: C = None
        self.u: H = None
        self.txt = txt

n = A("n")
a = B("a")
c = C("c")
e = D("e")
h = E("h")
l = F("l")
i = G("i")
b = H("b")
d = I("d")

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